Pages

Friday, March 6, 2015

include Javascript inline in drupal form api

include Javascript inline in drupal form api

Say, You want to include a Java Script code, inline in drupal form api.

drupal_add_js () shall be used.

Ex. :

While using this method, No need to add <script> tags.
This method will automatically include those tags. Just We need to mention the Java script methods / variables .

drupal_add_js (' alert ( \' Hello World ! \') ' , 'inline' );

No comments:

Post a Comment