请问img有没有empty属性? img没有empty属性吧可能是自己设的属性,以作判断 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果是自己添中的属性。那为什么我下面的代码会出错?(myNum是我随意添加的一个属性)Untitled-5.js:// JavaScript Documentfunction Test(){ var tempImage=new Image();}Test.prototype.Set=function(){ this.tempImage.myNum=0;}Test.prototype.Click=function(){ this.Set(); alert(this.tempImage.myNum);}Untitled-4.html:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script language="javascript" src="Untitled-5.js"></script><script language="javascript">InsTest=new Test();</script></head><body><div id="aa" style="position:absolute; left:10px; top:10px; widows:400px; height:300px; background-color:#FF99FF" onclick="InsTest.Click();">TEST</div></body></html> Try: var tempImage=new Image();==> this.tempImage=new Image(); ls正解tempImage undefined 求一个正则表达式 关于灰调在火狐下不起作用的问题 ajax 实现菜单树 谁知道怎么能在页面上显示矢量图(.cdr),能不能给段源码作参考,在线等答 得到对象的绝对坐标 如何使用js cookie,让浏览器恢复历史信息(在线,散分) 在检验表单输入时,为什么弹不出错误信息 FCKeditor编辑器中怎么用JAVASCRIPT取得当前编辑器中的值?? 如何判断页面中插入的<script>标签中所生成的超链接是否被点击过? 脆求:各位大虾来帮我看看吧,我搞了一天了! 挑战一下,关于js自动点击一个链接 javascript中读取html控件的值的问题
Untitled-5.js:// JavaScript Document
function Test()
{
var tempImage=new Image();
}
Test.prototype.Set=function()
{
this.tempImage.myNum=0;
}
Test.prototype.Click=function()
{
this.Set();
alert(this.tempImage.myNum);
}
Untitled-4.html:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" src="Untitled-5.js"></script>
<script language="javascript">
InsTest=new Test();
</script>
</head><body>
<div id="aa" style="position:absolute; left:10px; top:10px; widows:400px; height:300px; background-color:#FF99FF" onclick="InsTest.Click();">TEST</div>
</body>
</html>
==>
this.tempImage=new Image();
tempImage undefined