Drupal-7 - how to hv AJAX form function in "basic page" content
i want to ask if i want to add jquery AJAX form function in a Drupal "Page" content, where should i add the javascript code (just typed in the "page" body)? and where would be the form target (the backend process script) ??
or i need to write a mod开发者_开发知识库ule instead of using "page" content?
thx.
you can simply add jquery inside page by using following function which is responsible for including jquery file inside your page
<?php
drupal_add_js('--your jQuery code--','inline');
?>
you can also include the js file by
drupal_add_js(drupal_get_path('module', 'module-name') .'/myjquery.js');
remember! use 'jQuery' instaed of $ sign inside jQ code.
精彩评论