I have the following code which opens a new window when a user clicks on a button:
$('.loginButton').click(function () {
var strString = $("#medlineSearch").val()
var strSearch = ";query=";
var url = strSearch + strString;
alert(strSearch+strString);
var windowName = $(this).attr('id');
window.open(url, windowName, "height=750,width=1250,scrollbars=1,resizable=1,location=1");
// custom handling here
return false;
});
What I am looking to do is allow the user to enter something else in the address bar which seems to be read only.
Is there any way to change that?
I have the following code which opens a new window when a user clicks on a button:
$('.loginButton').click(function () {
var strString = $("#medlineSearch").val()
var strSearch = "http://google.&query=";
var url = strSearch + strString;
alert(strSearch+strString);
var windowName = $(this).attr('id');
window.open(url, windowName, "height=750,width=1250,scrollbars=1,resizable=1,location=1");
// custom handling here
return false;
});
What I am looking to do is allow the user to enter something else in the address bar which seems to be read only.
Is there any way to change that?
Share Improve this question edited Jul 29, 2016 at 13:05 Si8 asked Feb 14, 2014 at 20:02 Si8Si8 9,23522 gold badges119 silver badges223 bronze badges 1- possible duplicate of change url of already opened popup – joeytwiddle Commented Aug 21, 2015 at 1:09
2 Answers
Reset to default 3You cannot change the url in popup window.
Read change url of already opened popup
Trick to do so
open console and type location.href='http://link.'
If you want to be able to change it, set the target to _blank
.
This will prevent the new page to open as popup, but as new page.
window.open
( 'http://google.'
, '_blank'
);
The jsfiddle.