2011-08-01 260 views
1

This Link is a sample功能未定義

<script type="text/javascript" language="javascript"> 
$.blockUI({ overlayCSS: { backgroundColor: 'orange'} , message: '<img src="icon/wait.gif" /><div style=\'font-family:Tahoma;font-size:large\'> ...???? ??? ???? ??? ????</div>' });     

function UrlExists(url) 
{ 
    var http = new XMLHttpRequest(); 
    http.open('HEAD', url, false); 
    http.send(); 
    return http.status!=404; 
} 

function test() 
{ 
    var certification = ""; 
    var address; 
    var idCompany="821229021"; 
    var Empty = true; 
    for (var i = 0; i < 10; i++)         
    { 
     idCompany =idCompany + i.toString(); 
     idCompany=idCompany + ".png"; 
     address="Image/CertificationCompany/"+idCompany; 

     if (UrlExists(address)) 
     { 
      //certification += "<img style='margin:5px;padding:5px;cursor: pointer; border: 1px solid GrayText;' width='103px' height='80px;' src='Image/CertificationCompany/" + idCompany + "' />";        
      certification +="<a href='Image/CertificationCompany/" + idCompany + "' rel='prettyPhotoCertification[pp_gal]' title=' ?????? ????????? ???? "+document.title+"'><img style='margin:5px;padding:5px;cursor: pointer; border: 1px solid GrayText;' width='103px' height='80px;' src='Image/CertificationCompany/" + idCompany + "' alt='????????? ??' /></a>";      

      Empty = false; 
     } 

     idCompany="821229021"; 
     //$.unblockUI(); 
    } 

    if(Empty){ 
     certification = "updating<br /><img src='icon/Updated.png' />"; 
    } 
    $("#contentCertification").html(certification); 
} 

$.unblockUI(); 

</script> 

HTML

<input type="button" value="click me" onclick="test();"/> 

2)在IE中,$.blockUI()不起作用,看來,瀏覽器已經掛起。

This Link is a sample

+0

爲什麼使用內嵌JavaScript,'onclick =',當你有jQuery? – Sparky

+0

這些樣本的真正好處在於它們都沒有加載。 – SeinopSys

回答

0
<script type="text/jscript" language="javascript"> 

應該

<script type="text/javascript"> 
+0

這是正確的,問題2? – ashkufaraz

+2

我認爲這是容易只是ommit那些與普通''

0

你是如何加載jQuery和插件?確保您不使用自我關閉腳本標記,不適用於IE。

<script src="js/blockui.js" />  <!-- WRONG --> 
<script src="js/blockui.js></script> <!-- CORRECT --> 
+0

不會是這件事情 – ashkufaraz