函数未定义

发布于 2024-11-27 10:53:02 字数 2107 浏览 5 评论 0原文

此链接是示例

<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

<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) In IE, $.blockUI() does not work and it appears that the browser has hung.

This Link is a sample

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一抹微笑 2024-12-04 10:53:02
 <script type="text/jscript" language="javascript">

应该是

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

should be

 <script type="text/javascript">
长梦不多时 2024-12-04 10:53:02

你是如何加载 jQuery 和插件的?确保您不使用自关闭脚本标记,该标记在 IE 上不起作用。

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

How are you loading jQuery and the plugins? Ensure that you don't use a self closing script tag, doesn't work on IE.

<script src="js/blockui.js" />       <!-- WRONG -->
<script src="js/blockui.js></script> <!-- CORRECT -->
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文