Preload IFrame or load with Ajax
Hi all im building a web user interface. In this interface i use popup divs to capture user input and other tasks. On on of my popups i need to post a form so that i can handle uploaded files.
Id like to do this in an iframe so that it dosent effect the main page form.
I开发者_Go百科d like to know if there are any drawbacks to this method and if i should load the iframe into the page at startup or output the iframe via an ajax routine.
In my opinion, it's a nice solution for the fact that according to the standards you shouldnt have more than one form per page.
There is a small drawback: XHTML 1.0 strict does not allow iframes, so your pages wont validate against this doctype.
About your question: "should load the iframe into the page at startup or output the iframe via an ajax routine. ", If i understood your question right, I would load it on startup cause this way when u present it to the user it will be rendered, if you are using an ajax routine to load it when popup happens the user has to wait for it to download, render etc.
精彩评论