没看太懂,你可以吧水位写成变量
var water=32.2;
函数中用
s += '<tbody><tr><td>' + cz_name + '水位:'+water.toString()+'</td></tr></tbody></TABLE>';

解决方案 »

  1.   

    把水位作为函数的一个参数不就行了??
    function display(cz_name,sw)
             {
    window.status = "found!";
    var obj = msglyr;
    obj.style.left = event.x;
    obj.style.top = event.y*1 - 14*1;
    obj.style.width  = "108";
    obj.style.height  = "14";
    var s="";
    s += '<TABLE height="15" cellSpacing="0" cellPadding="0" width="100%" bgColor="#ffffff" border="0">';
    s += '<tbody><tr><td>' + cz_name + '水位:'+sw+'</td></tr></tbody></TABLE>';
    obj.innerHTML = s;
    obj.style.visibility = "visible";
    }