本帖最后由 WildGhost 于 2014-01-02 09:01:57 编辑

解决方案 »

  1.   

    script动态加载google的页面,参数附加客户的动作js无法直接操作跨域的iframe内容,ajax不能直接请求跨域页面,看你js要进行什么操作了,不是说所有跨域操作都不允许
      

  2.   

    有的允许了。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
    transitional.dtd">
    <html>    
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
            <title>
                xxx
            </title>
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
            </script>
            <script type="text/javascript">
                jQuery(document).ready(function() {
                    $.ajax({
                        type: "get",
                        async: false,
                        data: {                        
                        },
                        url: "http://www.geonames.org/postalCodeLookupJSON?postalcode=10504&country=US",
                        dataType: "jsonp",
                        jsonp: "callback",
                        success: function(json) {                        
                            for (var e in json.postalcodes[0]) {                       
                                document.write(e + "--->" + json.postalcodes[0][e]+"<br/>");                            
                            }
                        },
                        error: function(XMLHttpRequest, textStatus, errorThrown) {
                            alert(XMLHttpRequest.status);
                            alert(XMLHttpRequest.readyState);
                            alert(textStatus);
                        }                });            });
            </script>
        </head>
        
        <body>
          
        </body></html>
      

  3.   

    用jquery 的jsonp数据格式。
      

  4.   

    script src
    img src
    iframe src都可以跨域请求
      

  5.   

    一般封装好的ajax都用
    script src  来跨域的。