<div class="codetitle"> <span><a style="CURSOR: pointer" data="78799" class="copybut" id="copybut78799" onclick="doCopy('code78799')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code78799"> <br>//返回多个数据方法 <br>function getPos(){ <br>var xx = "xx"; <br>alter(xx); <br>var yy = "yy"; <br>return{x:xx,y:yy}; <br>} <br>//调用 <br>function getXY(){ <br>var ret = getPos(); <br>alert(ret.x); <br>alert(ret.y); <br>} <br> </div> <br>