码上敲享录 > js常见问题解答 > 使用script标签解决浏览器跨域问题

使用script标签解决浏览器跨域问题

上一章章节目录下一章 2020-04-22已有1003人阅读 评论(0)

使用script标签解决浏览器跨域问题


解决方法:

const script = document.createElement('script');

       script.type = 'text/javascript';

       script.src = 'http://xxx/designer?callback=callbackMethod';

       document.body.appendChild(script);


function callbackMethod(data){

     alert(data)

}


向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交