跨域问题

Posted 随缘梦中人

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了跨域问题相关的知识,希望对你有一定的参考价值。

 string callback = Request["callback"];
            string json = "{‘name‘:‘zhaoyihao‘,‘age‘:18}";
            Response.Write(callback+"("+json+")");
<script type="text/javascript">
        function json (data) {
         console.log(data.name);
    }
        var script=document.createElement(‘script‘);
        script.src="http://localhost:1095/index?callback=json";
    document.body.appendChild(script);
    </script>

 

以上是关于跨域问题的主要内容,如果未能解决你的问题,请参考以下文章