很有意思的两种连接 ,效果相同。 不同之处: aehyok({"result":"我是远程js带来的数据"});   

<script type="text/javascript" src="http://www.yourtour.cc/c.js" ></script>  不能放在fucntion  aehyok 上面,否则失效
<html>
    <head>
        <title>index.html</title>
        
        <script type="text/javascript">
            function aehyok(data)
            {
                alert(data.result);
            }
            aehyok({"result":"我是远程js带来的数据"});
        </script>
        <script type="text/javascript" src="http://www.yourtour.cc/c.js" ></script>
    </head>
    <body></body>
</html>

 

 

<html>
    <head>
        <title>index.html</title>
        
        <script type="text/javascript">
            function aehyok(data)
            {
                alert(data.result);
            }
            
        </script>
        <script type="text/javascript" src="http://www.yourtour.cc/c.js" ></script>
    </head>
    <body></body>
</html>
跨域请求数据

作用,可以实现跨域请求数据

相关文章:

  • 2021-05-27
  • 2021-09-09
  • 2021-06-10
  • 2021-10-08
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2021-12-07
  • 2021-06-17
  • 2021-05-29
  • 2021-10-13
  • 2021-07-31
相关资源
相似解决方案