Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-30-2012, 02:43 AM   PM User | #1
vegetto4093
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
vegetto4093 is an unknown quantity at this point
need help translating

i know nothing about java script, but i need to translate this so another program can understand it.

here's the code:

function jal(str){var zwq = '';for(var i=0;i < str.length;i++){zwq += ''+str.charCodeAt(i).toString(16);}return zwq;}

where the str = "http://atdhenet.tv/"

there's another var that is assigned like this

var kol = jal("http://atdhenet.tv/")

so i just need to know what var kol will end up being :/

thanks for all your help
vegetto4093 is offline   Reply With Quote
Old 12-30-2012, 06:54 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
You could have found out by simply creating an HTML page with *ONLY* this content:
Code:
<script>
function jal(str){var zwq = '';for(var i=0;i < str.length;i++){zwq += ''+str.charCodeAt(i).toString(16);}return zwq;}

var kol = jal("http://atdhenet.tv/");

document.write(kol);
</script>
and then showing that HTML page in your browser.

You would have seen:
Code:
687474703a2f2f61746468656e65742e74762f
But you could also have translate it by hand by simply looking up the hexadecimal value of each character in the string.

That is, "h" has hex value "68", "t" has value "74", etc.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:32 PM.


Advertisement
Log in to turn off these ads.