HTML: open page itself in new window - html

I want to open HTML page itself in a new window.
After clicking at the button I want that page will open in a new window. But I dont want to edit main page where the button is located, but I want to edit that page, which will be opened after clicking.
Is that possible without using JavaScript?

No, what you want to accomplish is not possible without JavaScript. As #Piszu somewhat answered, you need to define this behavior either though JavaScript or through the target attribute of links pointing to it.
I may add as a matter of opinion that the more you try to fight default browser behavior, the more headaches you'll run into. There probably isn't a very good reason to be doing whatever it is that you're trying to accomplish.

<a href="http://yourLink.com" target="_blank" title="describe link">
Do you mean like this?
But edit page opened in new window without script is not possible.

Related

html changes won't show up in browser

I'm working on an assignment for a class where our teacher has given us a webpage built out with html and css. We are eventually supposed to create some animations with gsap, but first need to make our own edits to the webpage itself. I am using vscode and when I edit any of the html, the changes show up in my index.html, but not in the browser. Any idea why this is?
try to right click your browser and check in the sources to make sure it really saved your changes.
Try to use live server on VS Code and then whenever you save it will show up on the page.
-> https://techstacker.com/local-live-server-vscode/
Make sure you save the file and reload the page in the browser

Save as a blank html page instead of content

I am using asp.net web form and the content is displayed let just say in the about-us.aspx.
I know it is impossible to disable Save As option in the browser file menus, but is it possible to have users saving it as a blank HTML page instead of the content?
Even if you could disable the "save as" feature, which... no, you can't. But say for an instant you could. Anyone who wanted (a copy of your webpage) could just take a screen shot and print that. Or, they could open the source code and copy/save that. Saving the file isn't the only way that they can grab your content.
Is there a reason that you don't want them to copy it?
Are you trying to prevent people (in general) from seeing the page?
If there is some other consideration, please leave a comment so we can expand on this.

HTML won't link up to CSS when I open it again

My problem is that I linked the CSS correctly when I created my HTML file, but then when I try to edit the CSS the other day, it just didn't update my HTML file and I did save it of course. One way I can get around this is by deleting the CSS in my htdocs and creating a new stylesheet with the exact same contents then linking the new one to my HTML. Can you guys tell me why is this happening and how can I prevent this from happening again?
I think that the problem is with cache. You can try running the site in an incognito/private window of your browser.
You can also inspect the page and see if the new styles are loaded. You can also try Empty Cache and Hard Reload option when you right click the reload button on chrome browser while inspecting.
one way you can prevent it is by doing all your css in the actual html file like so
<head><style></style></head>

How to open an iframe from clicking an image

I'm wondering if anyone can help me. I'm hoping I can open an iFrame in the centre of my webpage from clicking a picture. So in effect the iframe would be hidden until the picture is clicked. I have a very small and simple upload form on another page that I would like to appear when the user needs to upload and click the picture. I've had a good look round on this site and google in general but not found what I'm looking for, or the basics weren't included because it's common knowledge for most people here. Would there also be a way of closing this when it's finished uploading too? The form currently diverts to the homepage when finished so It would be handy to have a close option as in the end (post successful upload) the iframe contents will be the same as the page it's displayed on.
The best/easiest I have come across has been on w3schools but I have read using html for iFrames is not widely accepted or it isn't the best option cross-browser.
I have been viewing and trying different code but without even the basic knowledge I can't get my head around it.
If anyone is able to help, please assume I'm 5 years old. I'm not daft but in terms of code I'm literally just starting.
Thanks in advance
You would need to add a javascript onclick function to your img tag which would open a new window upon a click. You would pass the window.open function the name of the html file you want to display. Something like this:
<img src="image.jpg" onclick="window.open('welcome.html')">

Simplest HTML anchor issue

I am actually stumped on HTML.. can't believe it.
So, I have a submenu which is powered by JavaScript.
<span>SubPage</span>
I have deleted my JS and it still happens so I obviously misunderstand something.
When I load a page its a bit slow and I have time to hit the sub menu button. If I keep tapping this while the page is loading, instead of putting the hash on the end of the url and not changing the page it is taking me /dir/# which is resetting the page.
Any idea why?
Maybe the page is still in your browsers cache. Look at the source to make sure the JS is not there, or press Ctrl+F5.
Most JS coding is done after page has finished loading to make sure the elements are there.
Common solution to the problem you describe is have the link hidden (CSS style) or disabled by default then show or enable it in the JS code.
Basic example:
<a href="#" class="subpage" disabled="disabled">
Then in the JS code add something like this:
oLink.disabled = false;
Edit: Stupid me! Just change the href to:
href="javascript:void(0);"
This way clicking it won't have any effect until the JS kicks in.