max7
asked on
Firebug does not show value of hidden field?
Greetings,
Check this code out:
So I have a hidden field with the ID loginProvider that receives the name of a
social networking site using plugin. Then, based on the name found in the value
loginProvider, it selects the appropriate image to appear in the ID social_icon.
It all works fine but I *thought* using firebug, I should see the name of the
social networking site appear in the value of loginProvider, but I did not. To
verify it was working, I needed to alert the value of loginProvider instead.
Shouldn't firebug show the value attribute of the hidden field being populated?
Check this code out:
var socialProvider = $('#loginProvider').val();
$('#social_icon').attr({
src:'images/social_icons/'+socialProvider+'.png',
alt: ''+socialProvider+''
});
$('#msggigyacomplete').css('margin-top','-25px');
}
So I have a hidden field with the ID loginProvider that receives the name of a
social networking site using plugin. Then, based on the name found in the value
loginProvider, it selects the appropriate image to appear in the ID social_icon.
It all works fine but I *thought* using firebug, I should see the name of the
social networking site appear in the value of loginProvider, but I did not. To
verify it was working, I needed to alert the value of loginProvider instead.
Shouldn't firebug show the value attribute of the hidden field being populated?
why the bracket line 7?
ASKER
>>>why the bracket line 7?
it's actually part of another function which I did not show since I didn't think it was necessary for the question but here is the entire block:
it's actually part of another function which I did not show since I didn't think it was necessary for the question but here is the entire block:
$('#msglogingygia1,#msglogingygia2,#loginDiv').hide();{
$('#msggigyacomplete').show();
$('#loginProvider').val(logingygia.loginprovider);
var socialProvider = $('#loginProvider').val();
//var socialIconImg ='images/social_icons/'+socialProvider+'.png';
$('#social_icon').attr({
src:'images/social_icons/'+socialProvider+'.png',
alt: ''+socialProvider+''
});
$('#msggigyacomplete').css('margin-top', '-25px');
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
>>>Wrong javascript line 1 (the semicolon) : .hide();{
Thanks for pointing that out ... since the code runs ok with the semicolon, I assume jquery is slightly forgiving of some poor syntax?
So ... any ideas why firebug does not show the value attribute of the hidden field being populated? Again, I know it the attribute is receiving the data since I can alert it.
Thanks for pointing that out ... since the code runs ok with the semicolon, I assume jquery is slightly forgiving of some poor syntax?
So ... any ideas why firebug does not show the value attribute of the hidden field being populated? Again, I know it the attribute is receiving the data since I can alert it.
You may havve an error (on Firefox) before reaching the alert statement
ASKER
>>>You may havve an error (on Firefox) before reaching the alert statement
hmmm, I'm not sure what that means. what sort of error are you thinking of ?
hmmm, I'm not sure what that means. what sort of error are you thinking of ?
>what sort of error are you thinking of ?
Do you see any error in the console? Do you have public address to see your site?
Do you see any error in the console? Do you have public address to see your site?
ASKER
>>>Do you see any error in the console? Do you have public address to see your site?
No errors at all and unfortunately the site is not live yet.
How about this: from what you know of firebug should it normally show the value attribute being populated or not?
No errors at all and unfortunately the site is not live yet.
How about this: from what you know of firebug should it normally show the value attribute being populated or not?
with the javascript console yes of course
ASKER
Very odd ... I even corrected the error you pointed out in my code, thinking that might be preventing the value from populating but no dice. I don't know where to go from here.
ASKER
I stand corrected: I cleared my cache and checked again and sure enough, the value is populating now. I have to assume that the syntax issue with my which you pointed out was preventing this from happening before.
Thanks!
Thanks!