...

View Full Version : read info from other website(on the same web server)



mehere8
06-08-2010, 08:15 AM
can I use js to read info (e.g. getElementById('p')) from other web page stored under the same directory of the current webpage? how?

e.g. on this website www.mywebsite.com/home.htm, how to use js to read tag 'p' info from www.mywebsite.com/child1.htm ?

thx in advance

randomuser773
06-08-2010, 02:27 PM
can I use js to read info (e.g. getElementById('p')) from other web page stored under the same directory of the current webpage? how?

e.g. on this website www.mywebsite.com/home.htm, how to use js to read tag 'p' info from www.mywebsite.com/child1.htm ?
Presumably to want to read a document that is not currently loaded in any other frame. You can generate an iframe and load the target document into it. Then you access the document via the iframe's contentDocument property.
You must ensure that the document is loaded before reading it, using either the iframe's onload event or a try-catch construct that on error repeats after a the elapse of a timeout.

No I don't have any example code available.

mehere8
06-08-2010, 02:47 PM
hmmmm maybe it has sth to do with the safety

Kor
06-08-2010, 03:13 PM
See: AJAX (http://www.w3schools.com/Ajax/Default.Asp)

mehere8
06-09-2010, 09:44 AM
See: AJAX (http://www.w3schools.com/Ajax/Default.Asp)

how is this related to retrieve info from other webpage stored on the same web server? can you specify it?

thx



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum