How do you dynamically load a javascript file from different domain?

前端 未结 3 1984
小鲜肉
小鲜肉 2021-01-13 07:43

I find this excellent code, posted by aemkei as answers to this questions:

  1. How do you dynamically load a javascript file? (Think C’s #include)
  2. Use jav
3条回答
  •  渐次进展
    2021-01-13 08:28

    The security model in modern browsers prevents JavaScript from making cross-domain requests. That has holes (see every website exploit since the beginning of the internet), but using them is more than a little shady and it's only a matter of time before they're patched.

提交回复
热议问题