views:

40

answers:

2

Dear folks, A question that hasn't popped here before:

How to start downloading / truly loading a page (html or php) inside a jQuery modal/dialog window, AFTER a link or button is clicked?

See, currently i blieve that all .load() url objects HAVE to be inside the page and load is actually just opens them, doens't really start fetching data . am i right?

I thought perhaps I could achieve this if i put a iframe in the modal window, that way perhaps only the content of the iframe would be loaded when the dialog opens. then again, im pretty sure that the server reads the document with iframe src="page.php" and just loads them without showing it yet...

But what i want is that the content is NOT loaded, and only then clicked, it starts to get the files and image stuff from server. In other words: i want an old fashioned pup up window, but inside the cool jQuery / UI modal/dialog window.

Thanks so much for your wisdom and help. Ive been stuck achieveing this for ages Cheers from Holland, Sammy

A: 

you may wanna read this

http://articles.sitepoint.com/article/ajax-jquery

elmac
A: 

I also suggest to read something 'bout the principles of ajax, but let me try to answer your questions even if you already have done that.

Any calls to jQuery.load(...) have to be done on an existing element in your page, let's say an empty div element. The load() function then asynchronously fetches the data of the given url by starting a real HTTP GET request in the background, downloading whatever is returned and then pasting all retrieved data (usually html content) within the mentioned div element. This modifies the page source while the page is already visible and is commonly referred to as ajax. If it's indeed html content being pasted and it contains references to images, the browser will recognize it and issue more GET request to load the image ressources as it would be done on a regular html page.

For a small working example see here, if I got you right this might be exactly what you want to achieve.

jek