簡體   English   中英

將HTML頁面顯示為彈出頁面

[英]show a html page as a pop up page

我有一個彈出頁面,我想在單擊此按鈕時顯示它:

  <script type="text/javascript"> function open_infos() { width = 600; height = 400; if(window.innerWidth) { var left = (window.innerWidth-width)/2; var top = (window.innerHeight-height)/2; } else { var left = (document.body.clientWidth-width)/2; var top = (document.body.clientHeight-height)/2; } window.open('app.livarticles','articles','menubar=no, scrollbars=no, top='+top+', left='+left+', width='+width+', height='+height+''); console.log("error...") } </script> 
 <div class="btn-group"> <div class="btn btn-icon"> <a onclick="javascript:open_infos();" data-toggle="tooltip" title="xxxxxx"> <img src="img\\10536.png" class="mb-xs w-xs"> </a> </div></div> 

我使用AngularJS,這是路由文件config.router.js:

 .state('app.livarticles', { url: '/livraison/article', templateUrl: 'tpl/livarticles.html' }) 

但是該頁面沒有顯示在彈出頁面中,任何想法都困擾着我,並感謝更新:當我將URL手動放入腳本中時,這是我得到的:

  window.open('tpl/livarticles.html',......... 

在此處輸入圖片說明

app.livarticles不是正確的網址。 應該是這樣的:

 window.open('http://thesite.com/livarticles', ...);

https://developer.mozilla.org/en-US/docs/Web/API/Window/open

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM