Change the URL after creating a new page via JS

Viewed 18

I have a main page and in it there is an "add" button that adds an image on the screen with each click (like cards). Each image has an id and a name and they are arranged in an array in order.

Every time the "add" button is pressed I execute the command var newDoc = createHTMLDocument("image name")

I want to change the default url (about:blank) to something else, for example the name of the image (of course without spaces) so that I can put this URL in the onclick of the image and by clicking on the image, its page will open. I want to change the URL because I had many pages (1 for each image I create). You have to remember that my main page will have a lot of clickable pictures (cards) and each one has to open its own page.

My main problem right now is that I can't change the URL. I'm not sure accessing the URL and changing it is the right way to do it, but that's what I thought was needed. (I would love to hear more suggestions if any).

Right now it just generates HTML documents with a default URL that I don't even know how to get to.

In addition, I work on a computer locally that is not connected to any network at all and there is no server. Everything locally!

Many thanks to the helpers

0 Answers
Related