inungh Posted September 19, 2014 Share Posted September 19, 2014 I have following code to go to a link when user click on the button, the browser stay in the same Window, I would like to open a new Windows, I tried to add target = _blank, but no luck, Your help and information is great appreciated, Regards, Iccsi <a href="javascript:void(0)" id="aButton" onclick="javascript:window.location.href=GetLink();">My Link</a> function GetLink() { var url= "MySite.cfm?MyValue="+ document.Myform.MyText.value; return url; }; Link to comment Share on other sites More sharing options...
justsomeguy Posted September 19, 2014 Share Posted September 19, 2014 Using window.location.href changes the current page. You need to use window.open to open a new window. Link to comment Share on other sites More sharing options...
inungh Posted September 22, 2014 Author Share Posted September 22, 2014 Thanks a million for the information and help, It works now, Thanks again, Regards, Iccsi, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now