[英]Redirect to Local IIS server page from Hosted website in javascript
我將Web應用程序托管在本地IIS機器(工作PC)中,還將一個應用程序托管在服務器中。 在無法打印報告的情況下,我需要將值傳遞到本地IIS機器中的頁面,然后打開可以打印報告的頁面。
那可能嗎?
如果是,該怎么做?
我已經嘗試過像使用本地IP進行重定向一樣,但這是行不通的。
//碼
<script language="javascript" type="text/javascript">
function OpenPopupCenter(pageURL, title, w, h) {
var left = (screen.width - w) / 2;
var top = (screen.height - h) / 4; // for 25% - divide by 4 | for 33% - divide by 3
var targetWin = window.open("Report.aspx?Invoiceno=5555", "Print", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
</script>
在上面的代碼中,Report.aspx頁位於本地IIS服務器中。
擴展我的評論,您想使用http://localhost
所以:
<script language="javascript" type="text/javascript">
function OpenPopupCenter(pageURL, title, w, h) {
var left = (screen.width - w) / 2;
var top = (screen.height - h) / 4; // for 25% - divide by 4 | for 33% - divide by 3
var targetWin = window.open("http://localhost/Report.aspx?Invoiceno=5555", "Print", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
</script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.