View Full Version : Open urls sequencially

jan lee
08-27-2010, 01:32 PM

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?


Jan Lee:D

Old Pedant
08-27-2010, 08:39 PM
??? 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"???

jan lee
08-27-2010, 08:50 PM

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

Old Pedant
08-27-2010, 09:05 PM
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.

jan lee
08-28-2010, 01:49 AM
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


Jan Lee:D

Old Pedant
08-28-2010, 01:59 AM
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?

jan lee
08-28-2010, 02:14 AM

"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.



Old Pedant
08-28-2010, 02:24 AM
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.

jan lee
08-28-2010, 02:50 AM

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


Jan Lee