HTML:添加<样式和GT;和< SCRIPT>通过JavaScript代码样式、代码、LT、HTML

由网友(指尖の年华)分享简介:如果在网页中的JavaScript函数添加风格或 SCRIPT 元素的 HEAD 元素,将在浏览器中加载指定的样式和脚本,或将这样的编程更改页面后,忽略了DOM已经加载?If a JavaScript function in a web page adds STYLE or SCRIPT elements to th...

如果在网页中的JavaScript函数添加风格 SCRIPT 元素的 HEAD 元素,将在浏览器中加载指定的样式和脚本,或将这样的编程更改页面后,忽略了DOM已经加载?

If a JavaScript function in a web page adds STYLE or SCRIPT elements to the HEAD element, will the browser load the specified styles and scripts, or will such programmatic changes to the DOM ignored after the page has been loaded?

时的行为包括在所有主流浏览器?

Is the behavior consist across all mainstream browsers?

推荐答案

是的,你可以通过JavaScript添加脚本和样式表,他们将工作。谷歌Analytics(分析)做到这一点,例如。

Yes, you can add scripts and stylesheets via JavaScript, and they will work. Google Analytics does this, for example.

阅读全文

相关推荐

最新文章