+ 4

Who can help me making a binary code converter from letters to binary code?

I want to make a binary code converter with JavaScript and html please help me

7th Jul 2017, 11:27 PM
Walid Kh. Sharaiyra
10 ответов
+ 12
^~^ // Fixed with some visph's suggestions, i did not insert the 'else' to keep the code as readable as possible. ;) https://code.sololearn.com/Wq8zp4BF8Yc1/?ref=app
7th Jul 2017, 11:42 PM
Maz
Maz - avatar
+ 13
Nope, Google it is! ^^
7th Jul 2017, 11:45 PM
Maz
Maz - avatar
+ 10
Walid i can't speak for Andrew, but you can't steal my codes, just because i don't consider as "steal" any thing you can do with my works. Take it, sell it to the strangers or use my codes to build your nuclear weapon, in any case you can use all my codes without be considered as "stealer". All my knowledges come from people who share their knowledges, sharing that code i did the same. Glad it helped you, i recommend to replace the document.write( ) creating a paragraph tag and put inside it all the content, the write( ) method should be used for testing purposes only. All the best.
8th Jul 2017, 2:42 PM
Maz
Maz - avatar
+ 6
@Maz: The conditional statement in 'your' code is unnecessary, as it will always been true, because usr.length will be necessarly undefined or Number, but never be an empty string: if (usr.length !== "") You probably want to do: if (usr !== "") ... or: if (usr.length !== 0) ... after modifying also the first line by replacing: var usr = prompt('Insert your string') || 1; ... by: var usr = prompt('Insert your string') || ''; (else conditionnal statement need to be adapted ^^)
8th Jul 2017, 4:40 AM
visph
visph - avatar
+ 4
maybe you can use ASCII as a reference. every character is equivalent to a 7 bit binary code
7th Jul 2017, 11:38 PM
RKJ 🌹
RKJ 🌹 - avatar
+ 4
thaaaanks a lot @Maz you are the best of everything 😍😍
7th Jul 2017, 11:44 PM
Walid Kh. Sharaiyra
+ 4
@Andrew I saw your code before I ask this question..but I really don't want to steal your code and make it mine! anyway I didn't steal @Maz code but I've taken it and made some changes ..like the input was a prompt and now it's an input on the document and you could get the binary code as an alert, now you can get it as document.write https://code.sololearn.com/W7z5GTk2Ml9h/?ref=app
8th Jul 2017, 2:34 PM
Walid Kh. Sharaiyra
+ 3
what is ASCII ?
7th Jul 2017, 11:39 PM
Walid Kh. Sharaiyra
+ 3
Anyway you are perfect
7th Jul 2017, 11:46 PM
Walid Kh. Sharaiyra