Execute Javascript code in Drupal descriptions
Is it possible to execute Javascript code in th开发者_高级运维e Body/Description of a Drupal node? It won't be in PHP input mode.
Use drupal_add_js() in either a custom module or the theme template.php.
Although (not recommended) if you disable HTML Filter in the Input Formats, it should let you paste script code. This WILL open you up to XSS attacks though, depending on other settings.
Alert! This means your site is a high security risk. You're leaving it open to being used for Cross Site Scripting attacks. You'd be better of not implementing this idea. Developers are better of not advising someone on how to do this.
精彩评论