html, javascript - popup window

半腔热情 提交于 2019-12-25 08:48:12

问题


i have popup-window in my script. I use window.open, but almost all browsers block this kind of windows. So i wanna change it to another popup, which include php-script. I saw it at another sites. As i understand, they use ajax. Could you provide for me some more info?


回答1:


Try out the solution provided by thickbox, I think this is what you're looking for.




回答2:


First, you create a div (or other element) with the aspect you want, adding it the following extra CSS:

#popup {
  display: none;
  position: absolute;
  top: 100px; // changeable
  left: 100px; // changeable
}

Then you use JavaScript to change the CSS making the div visible, and add the XHTML response from AJAX to its innerHTML.

I'd recommend using jQuery or other easy-to-use framework if you're used to JavaScript / AJAX.



来源:https://stackoverflow.com/questions/1386436/html-javascript-popup-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!