views:

21

answers:

1

I'm using jQuery AJAX to retrieve a page with different user selected options. I'd like the page to appear by default with default options so in $(document).ready I call the function which contains the AJAX.

This creates a delay in loading as the browser first loads the actual page, then the jQuery javascript file and then finally it requests the other page.

How can I have the content already appear by default - is there something I can do server side (classic ASP)?

Thanks

+1  A: 

if you are putting the content inside a Div let's say...

<div id="my_dynamic_content">This is the default content, just put it here from server side code</div>

in your js code

$("#my_dynamic_content").html( data );

This way is the way I am providing alternate content for flash as well, I just put some content in the DIV and the replacing it in JS code.

Avi Tzurel
Thanks, thought so. From the server side, either get the content by simulating an AJAX call by POSTing data with ServerXMLHTTP, or put the code in the page I'm calling into a Subroutine and change the page I call to just call the Subroutine and then I can call the Subroutine for the default view.
Igor K