Reading Webpages using javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brett

    #1

    Reading Webpages using javascript

    I am writing a program that will allow a user to enter a webpage
    address into a form.
    Then it will download and display the webpage below the current one.

    example
    ----------------------------------------------------
    | _____________ |
    | _____________en ter web address | Load Button | |
    | -------------- |
    |______________ _______________ _______________ _______
    | |
    | |
    | web page will be displayed here |
    | |
    |______________ _______________ _______________ ______|


    Is there a way to download another web page using javascript and read
    through it.
    I am not too concerned with displaying the web page just downloading
    it. Has anyone done anything like this? the closest I have found was a
    procedure used by grease monkey "GM_xmlhtt" which is what I am looking
    for.

    Thanks in advance
    Brett

  • Randy Webb

    #2
    Re: Reading Webpages using javascript

    Brett wrote:[color=blue]
    > I am writing a program that will allow a user to enter a webpage
    > address into a form.
    > Then it will download and display the webpage below the current one.
    >
    > example
    > ----------------------------------------------------
    > | _____________ |
    > | _____________en ter web address | Load Button | |
    > | -------------- |
    > |______________ _______________ _______________ _______
    > | |
    > | |
    > | web page will be displayed here |
    > | |
    > |______________ _______________ _______________ ______|
    >
    >[/color]

    <form name="myForm">
    <input type="text" name="URLToAcce ss">
    <input type="button" value="Load Button" onclick="goToUR L()">
    </form>

    <iframe name="myIframe" ></iframe>

    function goToURL(){
    document.frames['myIframe'].src=document.m yForm.URLToAcce ss;
    }

    [color=blue]
    > Is there a way to download another web page using javascript and read
    > through it.[/color]

    Not if its from a different domain unless your page is locally run.
    [color=blue]
    > I am not too concerned with displaying the web page just downloading
    > it.[/color]

    If you don't want to display it, why are you downloading it?
    [color=blue]
    > Has anyone done anything like this?[/color]

    Actually, I have.
    [color=blue]
    > the closest I have found was a procedure used by grease monkey "GM_xmlhtt"
    > which is what I am looking for.[/color]

    Without seeing the function GM_xmlhtt, I would guess its just GM's name
    for an XMLHTTPRequest function.



    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

    Comment

    Working...