[英]Redirect to Local IIS server page from Hosted website in javascript
I'm having a web application hosted in local IIS machine(Working PC) and also a application hosted in a server. 我将Web应用程序托管在本地IIS机器(工作PC)中,还将一个应用程序托管在服务器中。 In a scenario where i cant print a report, i need to pass a value to the page which is in Local IIS machine and open the page where i could able to print the report.
在无法打印报告的情况下,我需要将值传递到本地IIS机器中的页面,然后打开可以打印报告的页面。
Is that possible? 那可能吗?
If yes, how to do that? 如果是,该怎么做?
I have tried like redirecting using the local IP but that doesn't work. 我已经尝试过像使用本地IP进行重定向一样,但这是行不通的。
//Code //码
<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>
In the above code the Report.aspx page is in the local IIS server. 在上面的代码中,Report.aspx页位于本地IIS服务器中。
Expanding on my comment you want to use http://localhost
so: 扩展我的评论,您想使用
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.