Basic setup to use jQuery in a JSP page

Before you can use jQuery in your page you’ll need to add some basics in the page header like so:

<HEAD>
   <script language="javascript" type="text/javascript">
      // function will wait until the page fully loads before executing
      $(document).ready(
         function(){
            runReport();
         }
      );
   </script>
</HEAD>

 The above code will execute the JavaScript function runReport() when the page is fully loaded in the browser.  You can add additional setup steps, such as setting variables inside function(){…} before the runReport() call.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s