Coding Villa Forum
FAQs
Advertisements

How to Decode JavaScript encoded Numeric string in to Text String in C#?

Iram Online 7/6/2012 6:11:58 PM

Hello Friends!

I am working on a website and I need convert or decode JavaScript encoded numeric string into Text string.For example I want to get the hidden Text from following javaScript encoded string.

"CJ11098713X1"

How can I perform that task.Please friends need your guidance to solve that problem.


Thanks

Share with Friends

Advertisements

Answer

Mehmood Online 7/7/2012 4:09:04 PM

A good thread contain the complete information.

-> what do you want to do?

-> What are your inputs and your outputs?

-> Which strategy are you following and why ?

-> Your problem scope?

-> Thread should be concise (but comprehensive. )


and what are you trying (your logic)?

Answer

Mehmood Online 7/7/2012 4:49:59 PM

Are you using some built-in methods of jQuery or you have created your owns for encoding or decoding?

If you are using your own customized one then your source logic will help you and if you are using some built-in mechanism then put your logic here so that i could be able to analyze something.

Are you decoding html entities or decodeURI() or unescape?

if unescape then follow the below approach.











======================See the Live demo=========================

http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_unescape

==============================================================

see the conversion functions then.

http://www.javascripter.net/faq/convert2.htm

http://www.w3schools.com/jsref/jsref_string.asp

Answer

Mehmood Online 7/7/2012 4:53:03 PM

<!DOCTYPE html>
<html>
<body>

<script type="text/javascript">

var str="!spinning cycle????";
var str_esc=escape(str);
document.write(str_esc + "
")
document.write(unescape(str_esc))

</script>
</body>
</html>

Share with Friends

Post reply

 

Enter This Code
Captcha
 

Subscribe

Email me when people reply


Subscribe to the