<script language="JavaScript1.2" src="aj.js">
I am calling function a() for my image onload event .but i am getting the error - function a() [a.js has function] is not defined.
我正在为我的图像onload事件调用函数a()。但是我得到错误 - 函数a()[a.js有函数]没有定义。
How to resolve this issue
如何解决此问题
1 个解决方案
#1
Add a closing script tag. Also mime type is more important than the "language" attribute, which pretty much every browser ignores.
添加结束脚本标记。 mime类型也比“language”属性更重要,几乎每个浏览器都忽略了这一属性。
<script type="text/javascript" language="JavaScript" src="aj.js"></script>
This, of course, assumes your src
points to the right location.
当然,这假设您的src指向正确的位置。
#1
Add a closing script tag. Also mime type is more important than the "language" attribute, which pretty much every browser ignores.
添加结束脚本标记。 mime类型也比“language”属性更重要,几乎每个浏览器都忽略了这一属性。
<script type="text/javascript" language="JavaScript" src="aj.js"></script>
This, of course, assumes your src
points to the right location.
当然,这假设您的src指向正确的位置。