Firebug does not show value of hidden field?

Greetings,

Check this code out:

var socialProvider = $('#loginProvider').val();
  $('#social_icon').attr({
	src:'images/social_icons/'+socialProvider+'.png',
	alt: ''+socialProvider+''
	});
  $('#msggigyacomplete').css('margin-top','-25px');
  }

Open in new window


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?
LVL 1
max7Asked:
Who is Participating?
 
leakim971Connect With a Mentor PluritechnicianCommented:
Wrong javascript line 1 (the semicolon) : .hide();{

do you want :
$('#msglogingygia1,#msglogingygia2,#loginDiv').hide(function() {
		 		$('#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');
});

Open in new window

0
 
leakim971PluritechnicianCommented:
why the bracket line 7?
0
 
max7Author Commented:
>>>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:

$('#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');
		 		}

Open in new window

0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
max7Author Commented:
>>>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.
0
 
leakim971PluritechnicianCommented:
You may havve an error (on Firefox) before reaching the alert statement
0
 
max7Author Commented:
>>>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 ?
0
 
leakim971PluritechnicianCommented:
>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?
0
 
max7Author Commented:
>>>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?
0
 
leakim971PluritechnicianCommented:
with the javascript console yes of course
0
 
max7Author Commented:
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.
0
 
max7Author Commented:
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!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.