jQuery is not loading in new window in Joomla

I have a page default.php in component module. default.php contains

defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();

And in default.php jQuery is successfully loaded and in console shows


In my default.php file I have a link, when I click that link it open a new window.

window.open("?view=report&format=raw&uid=" + ibonum, 'myWin', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=yes, scrollbars=yes, width=960, height=741');

In that page I use the code to load jquery:

defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();

But here (new window) jQuery is not loaded. Console shows:

 Uncaught ReferenceError: jQuery is not defined
    at <anonymous>:1:1

And also here $document->addScript is also not working.

so my question is: How I load jQuery in new window i Joomla?

My joomla version is 3.9.2

  • Could you please also copy your jQuery script in your question, the script you want to run in the new window. Do you run that script in the original window, or that script should be running in the new window only?
    – Zollie
    Jan 28, 2019 at 6:06
  • In orginal window jquery is working, but in new window jquery not working. Since there is no scope for jquery in new window I can't write any jquery code in new window. Jan 28, 2019 at 6:12

1 Answer 1


This is expected. As indicated by format=raw parameter in the URL, the page you are trying to open is a raw document and not a HTML document. Raw document only renders what's outputted by the component's view.

  • can I change to format=html , but gives 500 - Layout default not found. Jan 28, 2019 at 7:31
  • It means there's no default.php layout file for report view.
    – Sharky
    Jan 28, 2019 at 7:36
  • How can I make it working? any suggestions?? Jan 28, 2019 at 9:53
  • Sharky got the point since his answer is giving the light on the question. @DeepuSasidharan - You should just create default.php file in the report folder (and view) of whatever your component is and a layout of the page should be built up in that file. Please study Joomla and the documentation of Joomla at least a bit before you try to work with Joomla at all...
    – Zollie
    Jan 28, 2019 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.