Hi,
I need to get the url of newly created window, which will be obtained by clicking a button. I have got current url by using document.url. Similarly I need to get the url of new tab or window which is generated by clicking a button.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
DRISHTYPosted Sep 24, 2014, 1:44 AM
Try this :
var PopupUrl = "";
PopupUrl = 'http://www.google.com/images';
if(PopupUrl != "")
{
var doc=window.showModalDialog(PopupUrl, window,"scrollbars,resizable,width=500,height=400","");
alert(window.name);
}
Renjith V SPosted Sep 23, 2014, 8:05 AM
var winX = window.open('http://www.google.com/images', "newStuff", "height=500px,width=500px");
var x = winX.location.href;
alert(x);
The alert is about:blank
DRISHTYPosted Sep 23, 2014, 7:51 AM
var winX=window.open("newurl.htm","","width=100,height=50");
Then fetch child window url :
var x=winX.location.href;
alert(x);