繁体   English   中英

使用JavaScript从托管网站重定向到本地IIS服务器页面

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM