Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using window.open to open pop-up window.

As popup url contains query string information which i dont want to display to user.

I am also able to hide url from title of popup page, but some how while i am using

window.open, it creates entry in browser history.

Please help me how can i prevent my url to be added in browser history.

I have tried replace parameter in window.open function, but its not working..

I am using ie7 and ie8 browsers.
Posted
Comments
Vijay Radia 1-Jun-11 8:50am    
ok for now i have implemented alternate solution for this issue.. i have used document.replace menthod in javascript to repload the page again after using query string value.. this replaces my existing url having querystring with url without query string.

There is a fourth parameter to the window.open() function that allows you to replace the current entry in browser history instead of creating a new one. Please read about it here: http://www.w3schools.com/jsref/met_win_open.asp[^].

The default for this fourth parameter, which is called "replace" by the way, is false and that means a new browser history entry will be created for that call.

Cheers!

-MRB
 
Share this answer
 
Hi,

Use target=_blank property of HtmlAnchor, which will open in new window.

Example

<a href="yourURL" target="_blank">YourText</a>
 
Share this answer
 
v3
Comments
Vijay Radia 27-May-11 8:21am    
how can i use target=_blank with window.open?
That's Aragon 27-May-11 9:30am    
Updated for readability and add proper code block
fjdiewornncalwe 27-May-11 9:57am    
My 1: This isn't relevant to the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900