encoding javascript

  • Thread starter Alhambra Eidos Kiquenet
  • Start date
A

Alhambra Eidos Kiquenet

Hi all, misters.

What is difference between two encoding methods below and what method
can be considered more "web safe" ?
Important: fully retaining functionality of the original source code,
without the danger of misinterpretation of original code characters (code
contains long Registry entries, activeX, etc).

A option.


<script
type="text/javascript">document.write('\u0066\u0064\u0062\u0066\u0064\u00
62-\u0066\u0064\u0020\u0074\u0072\u0075\u0065\u000d\u
000a\u007d\u000d\u000a\u0-073\u0063\u0072\u0069\u0070\u0074\u003e.....')</script>



B option.


<script language="text/javascript"">
<!--
document.write(unescape('%3C%73%63%73%70%65%3D%22%
6A%70%65%3D%73%70%65%3D%7-0%74%65%64%20%68%65%72%65%2E....'));



//-->
</script>



I have no idea why this happens and I don't find nothing on Internet.
Any good sample code or reference ?


Any help will be appreciated, and I'll be very grateful. Thanks in advance.
Greetings, best regards.
 
B

bruce barker (sqlwork.com)

option 1, is a javascript unicode literal. option 2 uses url encoding (hex)
for an ascii string.

what do you mean by web safe?


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top