Posted by zerocool22 on February 7, 2013 at 10:59am
Hello,
Can I use javascript in the pages? I mean you can insert html if you click on html code on the page. But will it also accept java? or not?
Thanks
Hello,
Can I use javascript in the pages? I mean you can insert html if you click on html code on the page. But will it also accept java? or not?
Thanks
Comments
The real answer is no. If you
The real answer is no. If you save a page as php (with php module enabled) sometimes js works. But it is a horrible hack and does not work reliably.
Digit Professionals
Might be a better idea to
Might be a better idea to save the javascript in a file. Then as mentioned by John_B, save the node with PHP Filter enabled, and use a function like drupal_add_js to add the javascript to the page.
For security reasons, core
For security reasons, core and most of the widely used modules (Views, etc.) strip all inline javascript. It is always better to add scripts to an external file. Most, if not all, contributed themes have an empty .js file waiting for your scripts. Otherwise, it is simple to add your custom files to the theme's .info file.