读书人

模态窗口中防止交付时页面刷新弹出新

发布时间: 2012-07-04 19:33:54 作者: rapoo

模态窗口中,防止提交时页面刷新弹出新的页面

?


Next check to see if your modal dialog now correctly refreshes itself.In some cases the modal dialog will still open a new window. For instance if you were using a JavaScript self.location.href= command then you will need to replace this with a simulated hyperlink click event. To do so, add a hyperlink to your page that is styled to be invisible (ie: <a href=”" id=”goLocation” style=”display:none;”>). Then replace your JavaScript self.document.location.href = ‘test.html’; with a click command to your hidden hyperlink as follows:
document.getElementById('goLocation').href = 'test.html';document.getElementById('goLocation').click();

参考 :http://jwcooney.com/2011/12/22/showmodaldialog-opens-a-new-window-on-submit-or-location-href/

?

参考 :http://blog.sina.com.cn/s/blog_4c6e822d0100r6jr.html


读书人网 >Web前端

热点推荐