Open Webpage Inside the Html Body [Closed]
I Use the Following Code for Open Webpage Inside the Html Page. but Its Opening in Another Tab Instead of That Html Page. I Need to Open Google Webpage Inside...
I use the following code for open webpage inside the HTML page.
but its opening in another tab instead of that html page.
I need to open google webpage inside of the HTML body instead of another tab?
3 Answers
In your HTML you might have something like
<body>
<iframe id="myIframe" src=""></iframe>
</body>
Then in your function
var url = '
document.getElementById('myIframe').src = url;
<!DOCTYPE html>
<html>
<body>
<iframe src="">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Look at w3school for this simple information.
I am guessing you trying open new page using _self. Try to add "_self" as next parameter in open. Read more here
Try following code
var Url = "";
window.open(Url, "_self");