动态加载JS文件 [英] Dynamically Loading JS Files

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

问题描述

此页:
http://www.hikksworld.com/loadJSFiles /

是我测试浏览器能力的地方,可以/不能使用以下三种方法之一动态加载JS文件:


1)更改脚本标记的src属性。

2)插入脚本src =""通过innerHTML在div中标记

3)使用document.createElement添加脚本元素。


页面上的第四种方法是编写脚本标记到一层,并且据我所知,它仅适用于NN4.xx(仅在Windows上测试过
Windows),但NN4.xx中的MAC测试会很大感谢

,仅仅是为了我自己的知识。


我没有的是访问在Linux或MAC上运行的任何浏览器/>
(严格来说是Windows访问)。我可以在页面上列出的以及不同操作系统中的浏览器以外的其他浏览器中进行测试吗?


非常感谢任何和所有反馈。


-

兰迪

机会有利于准备好的心灵

comp.lang.javascript常见问题 - http://jibbering.com/faq/

This page:
http://www.hikksworld.com/loadJSFiles/
Is one where I was testing the ability of browsers that can/can''t
dynamically load a JS file with one of the three methods:
1)Changing the src property of a script tag.
2)Inserting a script src="" tag in a div via innerHTML
3)Using document.createElement to add a script element.

The fourth method on the page is writing a script tag to a layer, and to
the best of my knowledge it only works in NN4.xx (only tested on
Windows), but MAC testing in NN4.xx would be greatly appreciated as
well, just for my own knowledge.

What I don''t have is access to any browsers running on Linux or a MAC
(strictly Windows access). Can I get it tested in browsers other than
whats listed on the page, and in different OS''es?

Any and all feedback is greatly appreciated.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

推荐答案

Randy Webb写道:

< snip>
Randy Webb wrote:
<snip>
我没有的是访问任何浏览器在Linux上运行
或MAC(严格的Windows访问)。我可以在
浏览器中测试,除了页面上列出的以及不同的操作系统吗?
What I don''t have is access to any browsers running on Linux
or a MAC (strictly Windows access). Can I get it tested in
browsers other than whats listed on the page, and in different
OS''es?




假设你自上次我们测试这个以来没有改变剧本,我有机会试用我上次使用的测试脚本

时间在Mac上几个星期前。使用safari没有任何方法

工作。使用Mac IE 5,innerHTML方法有效,但SRC设置

方法在分配给-src-property时出错,而

createElement方法出错完全相同点。


Richard。



Assuming that you haven''t changed the script since the last time we
tested this, I had a chance to try out the test script I was using last
time on a Mac a couple of weeks ago. With safari none of the methods
worked. With Mac IE 5 the innerHTML method worked but the SRC setting
method errored at the point of assigning to the - src - property and the
createElement method errored at exactly the same point.

Richard.


文章< Ep ************** ****** @ comcast.com>,

Randy Webb< hi ************ @ aol.com>写道:
In article <Ep********************@comcast.com>,
Randy Webb <hi************@aol.com> wrote:
本页:
http://www.hikksworld.com/loadJSFiles/
我正在测试浏览器的能力,它可以/不能动态加载一个JS文件的浏览器三种方法:
1)更改脚本标记的src属性。
2)插入脚本src =""通过innerHTML在div中标记
3)使用document.createElement添加脚本元素。

页面上的第四种方法是将脚本标记写入图层,并且
据我所知,它仅适用于NN4.xx(仅在Windows上进行过测试),但NN4.xx中的MAC测试将非常受欢迎,仅仅是为了我自己的知识。 />
我没有的是访问在Linux或MAC上运行的任何浏览器
(严格的Windows访问)。我可以在页面上列出的以及不同操作系统中的浏览器中进行测试吗?

非常感谢任何和所有反馈。
This page:
http://www.hikksworld.com/loadJSFiles/
Is one where I was testing the ability of browsers that can/can''t
dynamically load a JS file with one of the three methods:
1)Changing the src property of a script tag.
2)Inserting a script src="" tag in a div via innerHTML
3)Using document.createElement to add a script element.

The fourth method on the page is writing a script tag to a layer, and to
the best of my knowledge it only works in NN4.xx (only tested on
Windows), but MAC testing in NN4.xx would be greatly appreciated as
well, just for my own knowledge.

What I don''t have is access to any browsers running on Linux or a MAC
(strictly Windows access). Can I get it tested in browsers other than
whats listed on the page, and in different OS''es?

Any and all feedback is greatly appreciated.



我不确定输出应该是什么样子。你可以在你的网站上发布

屏幕图像吗?


我试过MacOS 10.2.6:

Netscape 7.1 - 得到了警告初始js文件已加载。得到了Windows表格。

在一个图层中加载它中的最后一个字母r边界稍微靠右边缘。

。黑色背景也向右移动了几个字符。

在heder行中没有看到垂直寄宿生。


IE 5.2 - 有警报初始js文件加载。标题行列没有

与表格中的数据列对齐。


Netscape 4.77在经典模式下运行。这是MacOS 9.22虚拟

访问不受支持的硬件设备,则本机9.x计算机的结果可能会有所不同。 Netscape两次放弃鬼魂。

我在初始加载页面时没有收到警报。我做了一个

重新加载我得到了警告初始js文件加载。当我在Netscape 4中点击更改它

时,我收到了警报。我没有注意到任何变化。两次,

一半的文字在Netscape 4中改变它的文字变成红色而另一个是b $ b蓝色。单击此文本,崩溃了Netscape 4.77。


Robert


Robert



I am not certain what the output should look like. Could you post
screen images on your site?

I tried on MacOS 10.2.6:
Netscape 7.1 -- Got alert initial js file loaded. Got Windows table.
The last letter r in "Load It In A Layer" was slightly to the right of
the border. The black background went a few characters to the right too.
No vertical boarders were seen in heder row.

IE 5.2 -- Got alert initial js file loaded. Title row columns didn''t
align up with data columns on table.

Netscape 4.77 running in classic mode. This is MacOS 9.22 virtual
machine. Results may differ in a native 9.x machine if application
access unsupported hardware devices. Netscape gave up the ghost twice.
I didn''t get an alert when initailly loading the page. I did on a
reload I got alert initial js file loaded. When I clicked on Change it
in Netscape 4, I got an alert. I didn''t notice any changes. Twice,
half the text in Change it in Netscape 4 text turned red and the other
blue. Clicking on this text, crashed Netscape 4.77.

Robert

Robert


Randy Webb写道:
Randy Webb wrote:
这个页面:
http://www.hikksworld.com/loadJSFiles/
我正在测试浏览器的能力,它可以/不能动态加载一个JS文件这三种方法之一:
1)更改脚本标记的src属性。
2)插入脚本src =""通过innerHTML在div中标记
3)使用document.createElement添加脚本元素。

页面上的第四种方法是将脚本标记写入图层,并且
据我所知,它仅适用于NN4.xx(仅在Windows上进行过测试),但NN4.xx中的MAC测试将非常受欢迎,仅仅是为了我自己的知识。 />
我没有的是访问在Linux或MAC上运行的任何浏览器
(严格的Windows访问)。我可以在页面上列出的以及不同操作系统中的浏览器中进行测试吗?

非常感谢任何和所有反馈。
This page:
http://www.hikksworld.com/loadJSFiles/
Is one where I was testing the ability of browsers that can/can''t
dynamically load a JS file with one of the three methods:
1)Changing the src property of a script tag.
2)Inserting a script src="" tag in a div via innerHTML
3)Using document.createElement to add a script element.

The fourth method on the page is writing a script tag to a layer, and to
the best of my knowledge it only works in NN4.xx (only tested on
Windows), but MAC testing in NN4.xx would be greatly appreciated as
well, just for my own knowledge.

What I don''t have is access to any browsers running on Linux or a MAC
(strictly Windows access). Can I get it tested in browsers other than
whats listed on the page, and in different OS''es?

Any and all feedback is greatly appreciated.



Mozilla 1.4在Linux下,只有CreateElement有效。

Konqueror 3.1.4在Linux下,第一页无法使用(看起来很可怕

我不能点击按钮。

Galeon 1.3.8在Linux下,只有CreateElement有效。


我也用Lynx测试过它,但是它是无法使用的。


-

在邮寄给我之前删除''dont_spam_me'和破折号。



Mozilla 1.4 under Linux, only CreateElement works.
Konqueror 3.1.4 under Linux, the first page is unusable(it looks terrible
and I can''t click the buttons).
Galeon 1.3.8 under Linux, only CreateElement works.

I also tested it with Lynx, but it was unusable.

--
Remove the ''dont_spam_me'' and the dashes before mailing me.


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

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