Passing numerical string with leading zero from asp.net razor to javascript - stange behavior -


i'm using javascript plug in highlight text on web page.

the funktion simple:

  $("p").highlight("abc", true); 

this working perfect , highlights every occurence of 'abc' in every 'p' tag.

when call fkd way in razor:

@{     string marktext = "abc"; }  <script>   $("p").highlight(@marktext, true); </script> 

it works fine.

but when set numerical string leading 0 e.g.:

@{     string marktext = "0123"; } 

the javascript gets "83".

by way found out 123 octal = 83 decimal.

so question how can pass string "0123" straight forward javascript without transform?

best regards gertr


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -