Doing ajax with Jquery.

Posted by user272899 on Stack Overflow See other posts from Stack Overflow or by user272899
Published on 2010-03-26T22:28:23Z Indexed on 2010/03/26 22:33 UTC
Read the original article Hit count: 381

Filed under:
|
|
|

I have been loading content with ajax and all works fine. Here is my code

$(document).ready(function() { 

//Load a-z.php
//Timestamp resolves IE caching issue
var tsTimeStamp= new Date().getTime();
$.post('../../includes/categories/a-z.php',
      {action: "post", time: tsTimeStamp},
      function(data){
        $('#moviescontainer').html(data).slideDown('slow');
      });
return true;                           

});

My data inside a-z.php requires Javascript for it's content and when I load a-z.php onto my page the javascript doesn't work.

I am quessing that I need to link the relevant files to a-z.php and then load it via ajax.

Doesn't this kind of defeat the object of ajax?? That means that I will be loading the js files on the main page and then loading them again when I ajax a-z.php

I hope I made some sense.

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about php