In the opened empty Javascript window named

Open the preview URL in a new window and save the window name in session. So far I have not seen any way to specify the name of the window and open it blank

No window name I can't keep it in session

 window = window.open(previewUrl, '_blank', 
 "location=yes,height=800,width=1024,scrollbars=yes,status=yes")

      

Is it possible to set the window name later?

Window named does not open in new window

  var d = new Date(),m = d.getTime();
  window = window.open(previewUrl, m, 
 "location=yes,height=800,width=1024,scrollbars=yes,status=yes")
  if(typeof(Storage) !== "undefined") {  
       sessionStorage.previewWindow = m;
  } else {
      console.log('No Sesssion Storage');
  }       

      

Since the preview link does not open onclick of the anchor, I cannot set traffic to "_blank"

+3


source to share


1 answer


try to use it in your javascript after loading new page

window.name=winName

      

here you can see the documentation



But I think it will be difficult to transfer the name to another window. so try using a dynamic name for your new widows

window = window.open(previewUrl, myDynamicVar, 
"location=yes,height=800,width=1024,scrollbars=yes,status=yes")

      

0


source







All Articles