I recently found out over the weekend that iframes are not valid in XHTML strict. What would the correct way to refresh certain content then? A friend said just use divs and have JavaScript refresh them, is this true?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your friend is right in a sense. You can achieve a similar effect to iframes by using AJAX to load a page into a
<div>container. The problem is that AJAX requests are usually limited within the same domain, so you will not be able to load other websites. You can load other pages from your own domain though.AJAX is ridiculously easy with jQuery. Check out this function:
http://api.jquery.com/load/
This would be kind of pointless as you could just load the content using server-side methods, but it shows how easy loading another page can be with jQuery.