Instead of open an external web page into an iframe, I wonder if it’s possible to “read” the external web HTML code like the DIV tags and there content to create a new HTML page with XSLT?
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.
The below link is a sample that uses jQuery to read an XML file from the server and display the data on the page:
It is important to note that the returned data is strict XML. You could also return JSON.
I would strongly recommend using a framework (such as jQuery) to retrieve the data rather than use the XMLHttpRequest directly as there are numerous cross browser issues to consider. Also jQuery has a nice API for manipulating the DOM once you have retrieved the data.
EDIT
Below is an untested sample of how you could do something similar to the above example when retrieving an HTML file. Please note, I am glossing over some important jQuery functions. If you decide to go this route, you should read the Getting Started tutorial. In particular the bits about Selectors and Manipulation.