动态加载JavaScript源文件 [英] Dynamically load JavaScript Source files

查看:59
本文介绍了动态加载JavaScript源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将JavaScript源文件动态加载到网页的DOM.
我需要在网页中添加js文件,然后执行它.

How to Dynamically load JavaScript Source files to a DOM of the webpage.
I need to add the js file in the web page & then execute it.

推荐答案

从地址栏中?这个不成立.除非在HTML中使用脚本,否则它们没有任何意义.并且在涉及地址栏时(该地址栏始终包含一些URI,仅此而已),就没有任何其他上下文.完全没有意义.

—SA
From address bar? It makes no sense. The scripts mean nothing unless they are used in HTML; and at the point where address bar is involved (which always contains some URI, no more), there are no any other context. No sense at all.

—SA


这篇关于动态加载JavaScript源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆