关于JS函数调用的问题
如下JS代码:
var Wlocation = {
mouseMove: function() {
var x,y,xy;
x=document.body.scrollLeft+event.clientX;
y=document.body.scrollTop+event.clientY;
xy=x+ "| "+y;
return xy;
},
mouseMovex: function() {
var lxy,lx;
lxy=Wlocation.mouseMove(xy);
var MyString = lxy.split( "| ");
lx=MyString[0];
document.write(lx);
},
mouseMovey: function() {
var lxy,ly;
lxy=Wlocation.mouseMove();
var MyString = lxy.split( "| ");
ly=MyString[1];
document.write(ly);
}
}
下面是另外的html页面的调用方式:
<script>
var b;
b=Wlocation.mouseMovex();
document.write(b);
</script>
怎么出错呢?求救啊!
------解决方案--------------------出什么错啊?
------解决方案--------------------lxy=Wlocation.mouseMove(xy);
xy未定义
------解决方案--------------------var Wlocation = {
//貌似定义错误了吧试试prototype