<script type="text/javascript">
var pick = "0";
function getEventTrigger(event)
{
var x = event.target;
pick = x;
alert("The id of the triggered element: "+ x.id);
pick = x.id;
}
if(pick == "a"){
var a="1";
var result=("_Defalut").GetResult(a).value;
}
</script>//不知道错没错
<li><img alt="游戏" id="c" src="images/Game.png" onmousedown="getEventTrigger(event)">Click on this paragraph. An alert box will show which element triggered the event.</li> //有人说图片链接错了,求指教
总之在WebBrowse中出现了“无法获取未定义或null引用的属性id";
------解决思路----------------------
我这里
function getEventTrigger(event)
{
var x = event.target;
pick = x;
alert("The id of the triggered element: "+ x.id);
pick = x.id;
}没有问题
------解决思路----------------------
src="images/Game.png"
src="/images/Game.png" 用绝对路径
onmousedown="getEventTrigger(event)"
你都已经指定了 onmousedown 还怎么根据不同的事件呢
onmousedown="getEventTrigger(this)"