Created
June 29, 2012 16:31
-
-
Save drei01/3019010 to your computer and use it in GitHub Desktop.
ecommercehackday puzzle 2012
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bin (text) { | |
var output = '' | |
for (var i = 0 ; i < text.length; i+= 8) { | |
var c = 0; | |
for (var j=0; j < 8 ; j++) { | |
c <<= 1; | |
c |= parseInt(text[i + j]); | |
} | |
output += String.fromCharCode(c); | |
} | |
return output; | |
} | |
$.ajax({ | |
url: '/'+bin('010010010110110101000001010010000110000101100011011010110110010101110010'), | |
type:'POST', | |
data: { | |
action: 'getCode' | |
}, | |
success: function(response) { | |
$.each(response,function(key,val){ | |
alert(key);alert(val); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment