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 9 of 9
  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    14
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question Open urls sequencially

    Hello,

    How I open urls sequencially - one by time -, but automatically (each 5 seconds) from a list with dozens of URLs in the same iFRAME?


    I have what i think it is a simple question to answer.

    I have a button to open a new link in a iframe (in the same browser window). And what i need is that after i press the button, the link opened would come from a list of html sequencially.

    I dont want that the html opened would be from a random choice, but i want to be sequential.

    I hope that i'm being clear in my line of thought. Is this possible?

    cheers!!!

    Jan Lee

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,862
    Thanks
    78
    Thanked 4,418 Times in 4,383 Posts
    ??? First you said
    automatically (each 5 seconds) from a list
    and then you said
    i press the button, the link opened would come from a list
    So which is it???

    Automatic? Or only when the button is pressed?

    And what happens when you get to the end of the list? Do you go back to the top or say "no more links"???
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Aug 2010
    Posts
    14
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Well,

    I have to press the button! I want to simulate a simple and fan web crawler. Taking a list of urls the script open one by one stripout and save the contens into a database. The first part would be written in Javascript the end in ASP.

    I have "similar" thing using a HTA file, but I need press the button every time.

    At the end of the lins list it will stop simply.



    Jan Lee

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,862
    Thanks
    78
    Thanked 4,418 Times in 4,383 Posts
    Oh...you can't.

    You can't strip content using JavaScript. Period.

    You could load the URLs into a frame, yes. But then your JS code could not possibly "read" the contents of the other frame.

    Cross-domain scripting is not allowed.

    You *could* do this all in ASP code, but not in JavaScript.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    New Coder
    Join Date
    Aug 2010
    Posts
    14
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Well, well, well, the first step is done. I would need now a bit help to reset the textarea contents evey time that change the text placed on it.

    I am trying the following:

    <textarea onchange="document.getElementById('fred').value=''";>
    <textarea onfocus="document.getElementById('fred').value=''";>
    input submit

    document.getElementById('fred').value="";
    Regards

    Jan Lee

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,862
    Thanks
    78
    Thanked 4,418 Times in 4,383 Posts
    Sorry, don't understand.

    Looks to me like onchange would be what you want, but why do you want to ONLY set the value of 'fred' to blank and nothing more?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    New Coder
    Join Date
    Aug 2010
    Posts
    14
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Hi

    "fred" is the id of the textarea. No forms. It works fine no forms.

    The web page is placed on the iframe and automatically the source code is shown inside the textarea. No problems. I have the script to strip out the source code! My problem is "reset" the "source code" before a new page is placed on the textarea. Press the button? No. Any pressed button.

    Regards

    JanLee

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,862
    Thanks
    78
    Thanked 4,418 Times in 4,383 Posts
    Why not use the same button that you press to *get* the next URL to clear the textarea?

    Or if you are using a timer, just have it clear the textarea at the same time it starts the reload of the <iframe>.

    Not clear to me why you need the textarea if you have the <iframe>, but never mind.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    jan lee (08-28-2010)

  • #9
    New Coder
    Join Date
    Aug 2010
    Posts
    14
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Ok.

    Following your advice I found the exact position in the script to put the command line to reset the textarea.

    Regards

    Jan Lee


  •  

    Posting Permissions

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