> I posted this in the UI group and was told to put it in here...
>
> My problem is that I have a function that is to call blockUI both
> upon
> login and logout. BlockUI only fires upon logout.
> Here's my code:
> **code**
> function Processing(dataString,l_processing,control)
> {
> if (l_processing == "yes")
> {
> $().ajaxStart(function()
> {
> $.blockUI(
> {
> message: $
> ('img#l-processing'),
> css:
> {
>
> border: 'none',
>
> padding: '15px',
>
> backgroundColor: '#000',
>
> '-webkit-border-radius': '10px',
>
> '-moz-border-radius': '10px',
>
> '-ms-filter': 'progid:DXImageTransform.Microsoft.Alpha
> (Opacity=50)',
>
> 'filter': 'progid:DXImageTransform.Microsoft.Alpha
> (Opacity=50)',
>
> opacity: '.5'
> }
> })
> });
> if(control == "logout")
> {
> $.ajax({
>
> type: "POST",
> url:
> "logout.php",
>
> data: dataString,
> });
>
> ReloadPage();
> }
> else if(control == "login")
> {
> $.ajax({
> type:
> "POST",
> url:
> "login.php",
> data:
> dataString,
> });
> ReloadPage();
> //return
> false;
> }
> }
> l_processing = "no";
> control = "no";
> }
> **end code**
> All vars are being passed correctly. "else if(control == "login")"
> fires just fine, within the "if(l_processing == "yes")", but the
> BlockUI portion does not start. However, when control = "logout"
> BlockUI starts up just fine.
> I've done alerts and find that all variables being sent into the
> function are populating as they should.
> Any ideas?
>
It's hard to read your code. You can put the code in the pastie, or
pastebin, then put the url here.
You can put $.ajaxStart and $.ajaxstop outside the if block. This will
reduce the code complexity.
--
Donny Kurnia
http://blog.abifathir.com
http://hantulab.blogspot.com
http://www.plurk.com/user/donnykurnia
No comments:
Post a Comment