dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: URL content as a variable

  1. #1
    Join Date
    Jan 2004
    Posts
    3

    URL content as a variable

    How can I get the content(e.g HTML tags) of a URL as a string variable in Javascript?
    What I want to do is check the tags in a given URL, but to do this I need to get the URL contents into a string first.
    Any ideas?

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    var str=document.URL;

  3. #3
    Join Date
    Jan 2004
    Posts
    3
    No, I don't want the current page contents I want the html of a page returned by a URL, as a string.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Assuming the page has be loaded then document.body.innerHTML will give you it's contents

  5. #5
    Join Date
    Jan 2004
    Posts
    3
    No, the page is not to be loaded in the browser, just to become a text string so I can parse it in my javascript.

  6. #6
    Join Date
    Jul 2003
    Location
    Boston Area, Massachusetts
    Posts
    3,489

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles