IE6和.js包含问题? [英] IE6 and .js include problem?

查看:68
本文介绍了IE6和.js包含问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好


有时候,当我尝试将外部js文件包含在内时,我不知道具体到什么时候:


< script src =''myfile.js''>< / script>

。某些情况下不包含.js文件!!

要解决这个问题,我必须使用PHP作为:


< script>

<? include(''myfile.js''); ?>

< / script>


任何人都知道为什么.js文件不会一直包含在内?

-

Elias

Hello

Sometimes, I don''t know when exactly, when I try to include an external js file as:

<script src=''myfile.js''></script>

that .js file goes not included in some cases!!

To solve it, I had to use PHP as:

<script>
<? include (''myfile.js''); ?>
</script>

Anyone knows why that .js file is not being included all the time?

--
Elias

推荐答案

我不确定这一点,但它可能是因为你省略了

lang = javascript选项。

我总是使用:

< script language =" JavaScript" src =" berekening.js">< / script>

这似乎工作正常。

JW

I''m not sure about this, but it may be because you are omitting the
lang=javascript option.
I alway use:
<script language="JavaScript" src="berekening.js"></script>
which seems to work just fine.
JW

有时,当我尝试将外部js
文件包括在内时,我不知道具体到什么时候:
< script src =''myfile.js''>< ; / script>

某些情况下不包含.js文件!!
Sometimes, I don''t know when exactly, when I try to include an external js file as:
<script src=''myfile.js''></script>

that .js file goes not included in some cases!!



lallous写道:
lallous wrote:
你好

有时,当我尝试将外部js文件包含为:

< script时,我不知道具体到底是什么时候src =''myfile.js''>< / script>

在某些情况下不包含.js文件!!

要解决它,我有使用PHP作为:

< script>
<? include(''myfile.js''); ?>
< / script>

任何人都知道为什么.js文件不会被包含在内?

-
Elias
Hello

Sometimes, I don''t know when exactly, when I try to include an external js file as:

<script src=''myfile.js''></script>

that .js file goes not included in some cases!!

To solve it, I had to use PHP as:

<script>
<? include (''myfile.js''); ?>
</script>

Anyone knows why that .js file is not being included all the time?

--
Elias




Web服务器中的错误?浏览器中的错误?假设服务器及时响应了

请求,那么这是由

< script type =" text / javascript"引用的文件的唯一两个原因。 SRC =" myfile.js">< /脚本>并不总是加载。


检查您的Web服务器日志,看看是否在该

文件中报告了GET的任何错误。


我猜你只是假设它并不总是加载,因为你看到

客户端脚本错误会导致你结论。我建议总是加载

文件,但是客户端代码中的一些其他错误导致你看到的

问题。


再次,检查您的Web服务器日志,查看它是否无法提供myfile.js。


-

| Grant Wagner< gw ***** @ agricoreunited.com>


*客户端Javascript和Netscape 4 DOM参考可从以下位置获得:

* < a rel =nofollowhref =http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html\"target =_ blank> http://devedge.netscape.com /library/...ce/frames.html


* Internet Explorer DOM参考可从以下位置获得:

* http://msdn.microsoft.com/workshop/a...ence_entry。 asp

* Netscape 6/7 DOM参考资料于:

* http://www.mozilla.org/docs/dom/domref/

*为Netscape升级JavaScript的提示7 / Mozilla

* http: //www.mozilla.org/docs/web-dev e ... upgrade_2.html



A bug in the Web server? A bug in the browser? Assuming the server is responding to
requests in a timely manner, those are the only two reasons a file referenced by
<script type="text/javascript" src="myfile.js"></script> wouldn''t always load.

Check your Web server logs, see if any errors are being reported for the GET on that
file.

I''m guessing you''re just assuming that it''s not always loading because you are seeing
client-side script errors that leads you to that conclusion. I would suggest that the
file is always being loaded, but some other bug in your client-side code is causing the
problems you are seeing.

Again, check your Web server logs, see if it ever fails to deliver "myfile.js".

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html


你好


我尝试添加lang = javascript属性,但没有帮助。


脚本中没有错误,我正在检查是否通过警报来加载函数

(functionXYZ)


当外部.js文件被加载时,警报显示

函数体,否则它什么也没显示,我得到页面错误

缺少这些功能。


在同一个浏览器中(但有时候是不同的机器),有时它会加载外部的b $ b .js文件使用< script>有时它不会!


请参考服务器的日志,感谢提示。


-

Elias


Grant Wagner< gw ***** @ agricoreunited.com>在消息新闻中写道:< 40 *************** @ agricoreunited.com> ...
Hello

I tried adding "lang=javascript" attribute but that doesn''t help.

No there are no errors in the script, I am checking if the functions
are getting loaded by doing alert(functionXYZ)

When that external .js file gets loaded then the alert shows the
function body, otherwise it shows nothing and I get page errors due to
the lack of these functions.

In the same browser (but sometimes different machines), sometimes it
loads that external .js file using <script> sometimes it doesn''t!

Will refer to the server''s log, thanks for the hints.

--
Elias

Grant Wagner <gw*****@agricoreunited.com> wrote in message news:<40***************@agricoreunited.com>...
lallous写道:
lallous wrote:
你好

有时,当我尝试将外部js文件包含在内时,我不知道具体到什么时候:

< script src ='' myfile.js''>< / script>

在某些情况下不包含.js文件!!

要解决它,我不得不使用PHP作为:

< script>
<? include(''myfile.js''); ?>
< / script>

任何人都知道为什么.js文件不会被包含在内?

-
Elias
Hello

Sometimes, I don''t know when exactly, when I try to include an external js file as:

<script src=''myfile.js''></script>

that .js file goes not included in some cases!!

To solve it, I had to use PHP as:

<script>
<? include (''myfile.js''); ?>
</script>

Anyone knows why that .js file is not being included all the time?

--
Elias



Web服务器中的错误?浏览器中的错误?假设服务器及时响应
请求,那么这是由
< script type =" text / javascript"引用的文件的唯一两个原因。 SRC =" myfile.js">< /脚本>并不总是加载。

检查你的Web服务器日志,看看是否有关于该文件的GET报告的错误。

我是我猜你只是假设它并不总是加载,因为你看到了客户端脚本错误导致你得出结论。我建议总是加载
文件,但是客户端代码中的其他一些错误导致了你看到的问题。

再次,检查你的网站服务器日志,查看它是否无法提供myfile.js。

-
| Grant Wagner< gw ***** @ agricoreunited.com>



A bug in the Web server? A bug in the browser? Assuming the server is responding to
requests in a timely manner, those are the only two reasons a file referenced by
<script type="text/javascript" src="myfile.js"></script> wouldn''t always load.

Check your Web server logs, see if any errors are being reported for the GET on that
file.

I''m guessing you''re just assuming that it''s not always loading because you are seeing
client-side script errors that leads you to that conclusion. I would suggest that the
file is always being loaded, but some other bug in your client-side code is causing the
problems you are seeing.

Again, check your Web server logs, see if it ever fails to deliver "myfile.js".

--
| Grant Wagner <gw*****@agricoreunited.com>



这篇关于IE6和.js包含问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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