Jump to content

Get element info from external doc


Utherr12

Recommended Posts

I want to know if it's possible to load information like getElementById('id').value from an element found on another document (not on the current one).Or if it's not, could it be done with php ? For example the target document has a fixed number of div's whose id has the form "quote_#" , i want to get the # from that div's id and store it in a array then get a random element from it... then display the innerHTML of a parent element 'p' with the class "quote_body". I want to get random info's from an external web-site, but i don't want to store the information from there, i just want to read it. I will be just loading the document once, then scan for every div with that id.

Link to comment
Share on other sites

You can load other documents from the same domain using AJAX, but not from external sites. To do that you would need to use a server-side language, either to fetch the page verbatim and send it on, proxy-style, or to extract the wanted information and just use that. Once you have the page you can read the XMLHttpRequest.responseXML property to get a DOM object of the document.

Link to comment
Share on other sites

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...