简体   繁体   中英

Open popup window, set url, set focus, set window properties

bit of a basic question but my google searches seem to be turning up junk today.

I want to open a pop up window in Javascript, set the id so that any subsequent popups use the same window, activate the window, and remove all browser controls.

So far I have:

var win = window.open('myurl.com', 'mywin', 'location=no,height=undefined,width=undefined', false); grabberwin.focus()

Now when the window is active, clicking on another link with the url of the window correctly reactivates the same popup window.

However, if the urls are different (the query string data for the new click is different) the window needs to refresh, but it's just staying on the same url. Also, the url bar is still present.

How can I direct the window to reload using the new url?

You may need to disable caching on the page that you are opening. I had an issue where pages shown in a popup window were not changing and that sounds like a similar issue. Not sure what you are using to create the pages but in .net i added this to the base page to call on page load


        /// 
        /// Set the page to not Cache
        /// 
        protected void DontCache()
        {
            try
            {
                //Dont Cache
                Response.Expires = 0;
                Response.Cache.SetNoStore();
                Response.AppendHeader( "Pragma", "no-cache" );
            }
            catch ( Exception )
            {
                throw;
            }
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM