Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2009
    Posts
    108
    Thanks
    22
    Thanked 2 Times in 2 Posts

    read info from other website(on the same web server)

    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

  • #2
    Banned
    Join Date
    Nov 2008
    Location
    not found
    Posts
    284
    Thanks
    0
    Thanked 53 Times in 51 Posts
    Quote Originally Posted by mehere8 View Post
    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.
    Last edited by randomuser773; 06-08-2010 at 03:55 PM.

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Posts
    108
    Thanks
    22
    Thanked 2 Times in 2 Posts
    hmmmm maybe it has sth to do with the safety

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    See: AJAX
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Regular Coder
    Join Date
    Dec 2009
    Posts
    108
    Thanks
    22
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Kor View Post
    See: AJAX
    how is this related to retrieve info from other webpage stored on the same web server? can you specify it?

    thx


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •