开发者

Jquery Block on my document .ready function not working

I have this code,

I added JS Script file to my Master page.

 <script src="/Scripts/Jquery.blockUI.js" type="text/javascript"></script>

This Below code I have in my master page.on document.ready

<script type="text/javascript">
    $(document).ready(function () {
        $.blockUI({ message: $('#question'), css: { width: '275px'} });
        }); 
</script> 
<开发者_运维问答div id="question" style="display:none; cursor: default"> 
    <h2 class="padding"><br />An unexpected system error has occurred while processing your request.<br /></h2>
    <h3>We apologize for this inconvenience.<br />
     Please report this error to your system administrator with the following information:<br /><br />
     Session id is:</h3>
     <input type="button" id="OK" value="OK" /> 
</asp:Content>

On my Document.ready Function my BlockUi is not working?

can any body tell me why its not working?

thanks


Just going over some of the syntax in the blockUI Documentation and they had the following example:

$.blockUI({ message: '<h1><img src="busy.gif" /> Just a moment...</h1>' });

so for your case you might need:

$.blockUI({ message: $('#question').html(), css: { width: '275px'} });

I'm not sure if that .html() might help, you may want to try innerHtml() as well. I haven't used blockUI before, so just a shot in the dark here.

Hope it helps :)

EDIT: I stand corrected, your syntax seems to be correct according to the demo found here. It must be some syntax or reference error somewhere.

The issue could also be a lack of jQuery referencing in your script files (as blockUI requires at least v1.2.3+ of jQuery. Try putting the following in your scripts area to see if that solves your problem, or you could use the link below (in comments) to download the most recent version.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜