How to generate html page with a link [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
How do I implement video keys on my website?
Like when I click a link, it generates an html page containing a specific type of content and gets deleted in certain amount of time.
I haven't done anything code yet.
My only solution is to hard code every html page not generating it.
I don't know how to make those like in YouTube where they can generate "watch?v=[key]" like that
thank you in advance :)

You can use window.open() open new window
const openWidow = ()=>{
var win = window.open("https://www.youtube.com/watch?v=Gjnup-PuquQ", 'window name', config = 'height=500,width=500');
}
also can use window.close() close this window
reference Window.open

Related

How to connect to different websites using an API? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am trying to make a website wherein if the user clicks on a button, he/she gets directed to UN's website for more info. Please help are bare with me because I am very much new to coding.
Here is a basic example of creating a button that links to a new page when clicked (note: this will error when run on StackOverflow because of restrictions on the iframe used for Snippets, but it will work in other environments):
function setup() {
noCanvas();
let btn = createButton("Open");
btn.mousePressed(() => {
// This opens a link in a new window or tab:
window.open('https://stackoverflow.com/help/minimal-reproducible-example', '_blank');
});
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>

Popup HTML to last viewed page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am making an Chrome extension. I'm not an coding expert, but I understand the basics of html, css, and how to make an chrome extension.
I have an popup html, and I want to reference to other html pages, but every link will open in a new tab. I searched all over the internet, but I couldn't figure out how. When the popup is open on another page, and it closes, I want it to open on the same page. Is there an way, and how?
Thanks in advance.
Since I don't have a detailed context from your question, I'm gonna suggest you use <iframe> tag offered by HTML in order to load the desired page inside the popup
here's some useful reference
https://www.w3schools.com/tags/tag_iframe.ASP

How can i change the content of a different page, when my current page is closed? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
On my html page i have a function that is called when the page is closed.
I want this function to change some elements from a different page. Is that possible?
Unless you have a handle to that window because you created it, you'd have to save the information about the modification away somewhere. You could do this by storing the information on the server side. It could also be done purely client side using cookies or local storage.
A very simplistic cookie-based example:
page-to-close.html:
<body onunload="javascript:document.cookie='modified by other page'">
page-to-modify.html:
<script>
var message = document.cookie ? document.cookie : 'first visit'
document.write(message)
</script>

Need a way to refresh automatically update HTML if a text file changes [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm trying to create a non intrusive pop up that refreshes it's displayed text on the fly if the content in a local txt file has been changed. Not sure of the best method to go about this. Using html and js for this.
The popup reads from a txt file, pops up on screen for a few seconds then pops back down, but how could I read the file and change what is displayed automatically?
Any help would be appreciated.
You can't read from local files unless the user drags them into your page, or loads them with a file input. Once that is done, a lock is placed on the file so that the file cannot be modified.
Basically, you can't do what you want to do.

onclick javascript anywhere in site, open another site in new tab [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a wordpress site, and have some good traffic, I want that, if a visitor come first time and click any where on the site, a new tab will open with my an other site.
Is this possible? if yes then what will be the code? i need code in javascript.
regards
Try this:
$(document).click(function() {
var win=window.open(url, '_blank');
win.focus();
});
Replace your <body> tag with this one:
<body onclick="window.open('http://google.com', '_blank')">
Over a link , we can give the address and the target so that the required URL opens in a new window.
Click Here

Categories