简体   繁体   中英

Open my site with popup window

I just finished make a web application. But I want to open that application by popup window so there's nothing back button on the bar.

The flow is when we type my URL application, it's going to popup window. After then we can make a shortcut or bookmark that's page and when we click it, it's still opened in popup window.

I've tried the JavaScript code, but it's just when we click hyperlink in my application.When I'm typing an URL application, it's still not going smoothly.

Do you try push your javascript popup code on body tag's onload event?

for example:

<body onload="popup_new_window()"></body>

put a script where you want to open a window as

window.onload()

There might be so many parameters which you want to put. Just google the window.onload property

Alot of browser automaticaly block this thinks.

You can use something like:

$().ready(function(){  
   eval($('#el')).click());  
}); 

On a element set to the click function something like "openPopup()" and on ready open the popup!

<a​​ href='#asd' id='asd' onclick='openwindow()'>popup</a>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
<script>
function openwindow()
{
window.open("http://www.yoursite.com",
    "mywindow","location=1,status=1,scrollbars=1,width=100,height=100");
}

$().ready(function(){  
   $('#asd').click(function(){openwindow();});
   eval($('#asd').click());  
});​
</script>

You can not just have the page always open up without the toolbars. The browser does not work like that. Modern day browsers also show most of the toolbars you want to hide for security purposes.

Also opening it up in a pop up window onload is asking to be blocked by pop up blockers, plus you will be left with the original window.

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