是淘宝的,我没学过JS,高手帮帮我,QQ8078929TB.namespace("TC");TB.TC.OrderConfirm=function(){var g=YAHOO.lang,o=YAHOO.util.Dom,m=YAHOO.util.Event;var h=o.get("J_orderTable");var e=h&&h.getElementsByTagName("tbody");var b=[];var u={};var q,r,c;var k=null;var p;var n=document.createElement("div");n.className="hidden";document.body.appendChild(n);function s(){var z=this.options[this.getAttribute("lastIndex")];if(z.getAttribute("onetime")){var B=z.getAttribute("onetime");j(B);r[B].push(z.value);z.value=""}var A=this.options[this.selectedIndex];if(A.getAttribute("onetime")){var B=A.getAttribute("onetime");A.value=r[B].shift();if(r[B].length===0){x(B,this)}}this.setAttribute("lastIndex",this.selectedIndex);this.parentNode.parentNode.setAttribute("minus",A.getAttribute("minus"));i();o.get("J_costPoint")&&a.call(o.get("J_costPoint"))}function d(){this.parentNode.parentNode.parentNode.setAttribute("freight",this.options[this.options.selectedIndex].getAttribute("freight"));i()}function f(){var z=this;if(k){clearTimeout(k)}k=setTimeout(function(){a.call(z)},200)}function a(){var B=this.value;var z=o.getElementsByClassName("msg","div",this.parentNode)[0];if(!/^(\d+)?$/.test(B)){A.call(this,"\u4f7f\u7528\u79ef\u5206\u70b9\u6570\u5fc5\u987b\u4e3a\u5927\u4e8e\u6216\u7b49\u4e8e0\u7684\u6574\u6570");return}if(parseInt(B,10)>parseInt(o.get("J_maxValidPoint").innerHTML,10)){A.call(this,"\u60a8\u4f7f\u7528\u7684\u79ef\u5206\u70b9\u6570\u8d85\u8fc7\u4e86\u8be5\u6b21\u8ba2\u5355\u786e\u8ba4\u5141\u8bb8\u4f7f\u7528\u7684\u6700\u5927\u79ef\u5206\u70b9\u6570");return}if(z){o.addClass(z,"hidden")}o.get("J_cashMinus").innerHTML=parseFloat(String(-this.value/100).replace(/(\.\d{2}).*$/,"$1")).toFixed(2);i();function A(C){if(!z){z=document.createElement("div");z.id="J_pointHint";z.className="msg";this.parentNode.appendChild(z)}o.removeClass(z,"hidden");z.innerHTML='<p class="stop">'+C+"</p>"}}function l(){o.addClass(this,"s");t();v();if(g.trim(this.value)=="\u9009\u586b\uff0c\u53ef\u4ee5\u544a\u8bc9\u5356\u5bb6\u60a8\u5bf9\u5546\u54c1\u7684\u7279\u6b8a\u8981\u6c42\uff0c\u5982\uff1a\u989c\u8272\u3001\u5c3a\u7801\u7b49"||g.trim(this.value)=="\u9078\u586b\uff0c\u53ef\u4ee5\u544a\u8a34\u8ce3\u5bb6\u60a8\u5c0d\u5546\u54c1\u7684\u7279\u6b8a\u8981\u6c42\uff0c\u5982\uff1a\u984f\u8272\u3001\u5c3a\u78bc\u7b49"){this.value=""}o.removeClass(this,"off")}function w(){if(g.trim(this.value)==""){this.value="\u9009\u586b\uff0c\u53ef\u4ee5\u544a\u8bc9\u5356\u5bb6\u60a8\u5bf9\u5546\u54c1\u7684\u7279\u6b8a\u8981\u6c42\uff0c\u5982\uff1a\u989c\u8272\u3001\u5c3a\u7801\u7b49";o.addClass(this,"off")}}function y

解决方案 »

  1.   

    TB.namespace("TC");
    TB.TC.OrderConfirm=function(){
    var g=YAHOO.lang,o=YAHOO.util.Dom,m=YAHOO.util.Event;
    var h=o.get("J_orderTable");
    var e=h&&h.getElementsByTagName("tbody");
    var b=[];
    var u={};
    var q,r,c;
    var k=null;
    var p;
    var n=document.createElement("div");
    n.className="hidden";
    document.body.appendChild(n);
    function s(){
    var z=this.options[this.getAttribute("lastIndex")];
    if(z.getAttribute("onetime")){
    var B=z.getAttribute("onetime");
    j(B);
    r[B].push(z.value);
    z.value=""}
    var A=this.options[this.selectedIndex];
    if(A.getAttribute("onetime")){
    var B=A.getAttribute("onetime");
    A.value=r[B].shift();
    if(r[B].length===0){
    x(B,this)}}
    this.setAttribute("lastIndex",this.selectedIndex);
    this.parentNode.parentNode.setAttribute("minus",A.getAttribute("minus"));
    i();
    o.get("J_costPoint")&&a.call(o.get("J_costPoint"))}
    function d(){
    this.parentNode.parentNode.parentNode.setAttribute("freight",this.options[this.options.selectedIndex].getAttribute("freight"));
    i()}
    function f(){
    var z=this;
    if(k){
    clearTimeout(k)}
    k=setTimeout(function(){a.call(z)},200)}
    function a(){
    var B=this.value;
    var z=o.getElementsByClassName("msg","div",this.parentNode)[0];
    if(!/^(\d+)?$/.test(B)){
    A.call(this,"\u4f7f\u7528\u79ef\u5206\u70b9\u6570\u5fc5\u987b\u4e3a\u5927\u4e8e\u6216\u7b49\u4e8e0\u7684\u6574\u6570");return}
    if(parseInt(B,10)>parseInt(o.get("J_maxValidPoint").innerHTML,10)){
    A.call(this,"\u60a8\u4f7f\u7528\u7684\u79ef\u5206\u70b9\u6570\u8d85\u8fc7\u4e86\u8be5\u6b21\u8ba2\u5355\u786e\u8ba4\u5141\u8bb8\u4f7f\u7528\u7684\u6700\u5927\u79ef\u5206\u70b9\u6570");
    return}
    if(z){o.addClass(z,"hidden")}
    o.get("J_cashMinus").innerHTML=parseFloat(String(-this.value/100).replace(/(\.\d{2}).*$/,"$1")).toFixed(2);
    i();
    function A(C){if(!z){z=document.createElement("div");
    z.id="J_pointHint";
    z.className="msg";
    this.parentNode.appendChild(z)}
    o.removeClass(z,"hidden");
    z.innerHTML=' <p class="stop">'+C+" </p>"}}
    function l(){
    o.addClass(this,"s");t();v();
    if(g.trim(this.value)=="\u9009\u586b\uff0c\u53ef\u4ee5\u544a\u8bc9\u5356\u5bb6\u60a8\u5bf9\u5546\u54c1\u7684\u7279\u6b8a\u8981\u6c42\uff0c\u5982\uff1a\u989c\u8272\u3001\u5c3a\u7801\u7b49"||g.trim(this.value)=="\u9078\u586b\uff0c\u53ef\u4ee5\u544a\u8a34\u8ce3\u5bb6\u60a8\u5c0d\u5546\u54c1\u7684\u7279\u6b8a\u8981\u6c42\uff0c\u5982\uff1a\u984f\u8272\u3001\u5c3a\u78bc\u7b49"){this.value=""}o.removeClass(this,"off")}
    function w(){
    if(g.trim(this.value)==""){
    this.value="\u9009\u586b\uff0c\u53ef\u4ee5\u544a\u8bc9\u5356\u5bb6\u60a8\u5bf9\u5546\u54c1\u7684\u7279\u6b8a\u8981\u6c42\uff0c\u5982\uff1a\u989c\u8272\u3001\u5c3a\u7801\u7b49";o.addClass(this,"off")}}
    function y估计楼主不会结贴!