c# - Please explain the $ use in jquery -


hi have piece of code

$(document).ready(function () {    $("#txttstimmlen").blur(function () {       var myval2 = $("#txttstimmlen").val();       $hidden2 = $("#<%=dataimmlentb.clientid %>")       $hidden2.val(myval2)   });  }); 

is $hidden2 accessible inside blur function? or can accessed outside.

first of all..$ got nothing question @ all.. $ here name given variable. neither makes variable global nor local.. var infront of decalring variable does...

and question asked..yes!!! can accessed outside..since creating global variable here.

in given code... myval2 can accessed inside blur function .

  var $hidden2=... //^^^--here 

here add var in front ..this make variable local.. andcan accessed inside blur function ..

without var global variable , hence can accessed throughout codes


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -