跨域应用程序页面通过邮局调用显示

时间:2014-11-05 14:12:28

标签: javascript jquery cross-domain same-origin-policy allow-same-origin

我们在应用程序中显示其他域页面时遇到一个问题。 以下是问题:考虑应用程序NS和TPT,我需要在应用程序NS中显示应用程序TPT页面,我需要将敏感数据传递给从NS到TPT。

当我试图从TPT获取完整页面并在NS中显示时,我看不到浏览器中的数据,但我通过view-source看到完整的页面(由于同源策略)。

无论如何,我可以通过克服“同源政策”来完成这项工作吗?

以下是我在NS中使用的代码:

        $.ajax({
            url : "http://localhost:8090/tpt-web/jas/dashboard/home.action",
            type : "POST",
            cache : false,
            data : "USER:raj",
            dataType : "text",
            success : function(result) {
                var newWindow = window.open("http://localhost:8090/tpt-web/jas/dashboard/home.action", "", "height=815,width=680,top=0,right=250,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizeable=no");
                newWindow.document.write(result)
            },
            error : function(XMLHttpRequest, textStatus, errorThrown) {
                alert('Error occured while connecting to TPT application');
            }
        });

0 个答案:

没有答案