WebDirect

Welcome to WebDirect Programming basics.

<-- Back to Training Home

AJAX -- We use it to make pages work cleanly. It cleans up websites, and makes our applications run smoothly. Many projects we have worked on use AJAX...

  • Faculty profiles (for individual fields)
  • image database dashboard (to display updated dashboard information)

AJAX is really just some fancy javascript. Code Below:
<script type="text/javascript">
setContent('folders_progress', 'http://www.law2.byu.edu/image_db/includes/ajaxupdate.php', 'GET', '');
</script>

script just declares that it is javascript...

How do I use it?

function setContent( 1 , 2 , 3 , 4 ){...}

  1. id of a div or other element that will have the content pushed into
  2. url of page that will be placed into that element
  3. GET or POST (We just use GET)
  4. Just leave an empty string ''

If you have something that will need to be updated constantly.... (for instance the progress information on the image database dashboard) you may use the setInterval javascript function to update the page at intervals (as little as 20 ms works).