0
I would like to create a function that loads a random page from a given address. Something like www.meusite.com/(numeros entre 0-100).html
I think the function should create the tag A
, then fill in the text www.meusite.com/ + random number + .html
; and in the end be activated by onload
within the tag body
.
Is there anything you can do using JS? I believe so but I don’t even know where to start.
Thanks in advance for any help.
Can you explain better "activated by onload inside the body tag"? Want a random automatic redirect? or by clicking on a link that has a random address?
– Sergio
Without click, I would like it to be automatic.
– Kappa
Do you understand the implications for the user of going to one page and being redirected to another in the browser? That’s bad and the search engines don’t like it... You can’t redirect on the server?
– Sergio
Actually I’m trying to create a home page that opens random links every time I open the browser. links would be of pages with messages and frazes of the day of a specific site
– Kappa
I agree with Sergio, that this is the kind of pages that I avoid at all costs, where I’m on one page suddenly I’m magically taken to another at random.
– Isac
As I said above, the page itself will not be published, it will be stored locally on my Pc, it will be used as a home page. only the links will be online. theoretically I agree that it is quite annoying, but in this case how the redirect is for personal use I see no problem
– Kappa
You can do this by also displaying a section of the page with random information. Then that page could come as a
iframe
with random page or defined on the server– Jefferson Quesado