What am i doing wrong(layout not worked on yet) | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

What am i doing wrong(layout not worked on yet)

https://code.sololearn.com/WW2pe2yZSMdK/?ref=app

13th Apr 2020, 8:28 PM
Joshua Flynn
Joshua Flynn - avatar
21 Respuestas
+ 4
Too much for detail everything ;P (typo, case: getElementById, not getelememtbyid; lacks of input event handler, and lacks of window onload event handler): onload = function() { document.getElementById('farenheight').oninput = function() { let f = document.getElementById('farenheight').value; let c= (5/9)*(f-32); document.getElementById('celsious').value= c; }; }; ... guessing that's what you're attempting to do ^^
13th Apr 2020, 9:00 PM
visph
visph - avatar
+ 1
+ 3x getElementById not getelementbyId + missing { at end of line 5 + line 11 & 12 (2x ");") should be "};" (only once) + missing '*' multiplication operator line 10 (let c = (5/9)*(f-32);) I think I have not forget any of the correction I found to do... let me know if there's still some error (but you could try to investigate yourself: read carrefully the error message, go to the line targeted and try to figure what's happening and how to fix that ^^)
13th Apr 2020, 11:25 PM
visph
visph - avatar
+ 1
That's the best way to learn: facing errors, trying to understand what's happened... again and again: we'll never ends to debug and stuck on tiny details wich make we say after hours: "of course"; that's the unavoidable part of the process to write codes ;P
14th Apr 2020, 1:47 AM
visph
visph - avatar
+ 1
line 5 starts with: let f = error say unexpexted identifier, so we look before for what the interpreter would expect rather than a let keyword... line 4 ends with: function() Hey! Don't you see, now? There's expected an opening curly bracket ("{") before the declaration of the function body (content) :)
14th Apr 2020, 2:24 AM
visph
visph - avatar
+ 1
Sometimes, we have to look at very much far away from the targeted line by the interpreter... if we have the luck that the bug produce one... Because other times, we just have unexpected output and/or behavior: we then need to "trace" (either manually and/or with dedicated tools) the running path of our code, and that could turn out to evil journey :P
14th Apr 2020, 2:32 AM
visph
visph - avatar
+ 1
Obviously you could improve the interface ;) but it's a good way to just implement the strictly minimal element needed for ypur code and then implement the logic (js)... design and styling doesn't need to be advanced for programming. And so, without changing (too much) your actual html skeleton, you could implement the converse function, by enabling the celcius field to write, and updating the fahrenheit field with the converted celcius (without removing the actual conversion fahrenheit to celcius feature). ... and adding more fields / units for handling any combination of conversion... ... then maybe add element(s) to handle units selection for displaying only the selected unit fields? There's always some features we could add... the real difficulty is to not trying to implement a bunch of feature at once :D
14th Apr 2020, 3:12 AM
visph
visph - avatar
+ 1
Oh! Excuse me: I've missunderstood: I was believing that thats part was resolved :P your first line (of code, not the line 1) is: $().load = function () + missing the opening braket as sooner for the inner function + $(). sounds like trying to use jQuery, but if so, you need to import jQuery ^^... and anyway, that's not the proper way to do even I cannot say how to do without making some reference search (I'm not very skilled with jQuery wich I don't really like and quite never use)... simpler (and even better) to just use the window (implicitly) onload event (see my code in my previous post) + still typo in the 'getElementById': you forget to uppercase the 'B' + 'change' is also a valid event name (even 'input' is better suited, but differences are minimal), but the attribute names corresponding to each event (when the corresponding attribute exists) should be prefixed with 'on': .onchange (or .oninput, but not .change or .input) I believe that's all... but I could forgot something (it s was worked)
14th Apr 2020, 3:40 AM
visph
visph - avatar
0
Visph i put in your suggestions but it still isnt working
13th Apr 2020, 11:14 PM
Joshua Flynn
Joshua Flynn - avatar
0
thank you i spent a while trying to figure out the error
14th Apr 2020, 1:37 AM
Joshua Flynn
Joshua Flynn - avatar
0
I had several 9f those moments however on line 5 it says unexpected identifier https://code.sololearn.com/WW2pe2yZSMdK/?ref=app
14th Apr 2020, 2:18 AM
Joshua Flynn
Joshua Flynn - avatar
0
F*** how cpuld i have missed that i was too focused on that line to think of looking before it
14th Apr 2020, 2:26 AM
Joshua Flynn
Joshua Flynn - avatar
0
You are very helpful :)
14th Apr 2020, 2:26 AM
Joshua Flynn
Joshua Flynn - avatar
0
Im learning that
14th Apr 2020, 2:50 AM
Joshua Flynn
Joshua Flynn - avatar
0
Im trying to use this "simple" app to help learn the language
14th Apr 2020, 2:51 AM
Joshua Flynn
Joshua Flynn - avatar
0
You have any more suggestions for this app
14th Apr 2020, 2:52 AM
Joshua Flynn
Joshua Flynn - avatar
0
I already had plans on implementing several more metric conversions as soon as i get this part figured out
14th Apr 2020, 3:20 AM
Joshua Flynn
Joshua Flynn - avatar
0
Im just busy trying to get this part working first
14th Apr 2020, 3:21 AM
Joshua Flynn
Joshua Flynn - avatar
0
Any other recomendati9ns for getting this part figured out
14th Apr 2020, 3:21 AM
Joshua Flynn
Joshua Flynn - avatar
0
I will implement that later
14th Apr 2020, 8:46 PM
Joshua Flynn
Joshua Flynn - avatar
- 2
Hello, In this app, I can read in spanish?
14th Apr 2020, 7:04 PM
comitolo32 cascara
comitolo32 cascara - avatar