+ 17
I've created a calculator.
plz hit a like https://code.sololearn.com/WSRPKQa7f70G/?ref=app
25 Antworten
+ 17
Congratz 🎂
+ 8
... and functionality, what is the </invisible> tag and why it is putted inside the JS code?
It causes a console error..
+ 7
@rishita:
your calculator posted on last 5 hours
but @M. Oly Mahmud posted on last 10 hours
You should NOT COPY and PASTE yourcode🙁🙁
+ 6
good work ,creatives🤓🤓🤓
+ 6
You can surely do better, especially in code presentation/readability ;)
+ 6
@Πέτρος ΠΔ wrote: << fixed the errors >>
Not at all ^^
You've retrieved the <invisible> tag pointed by Maz, but whatelse?
Some advices:
- Insert line breaks and indent your code for better readability (even for you, that makes appear obvious errors :P)
- Use many <script> tags only if necessary for logic/readability
- Use lowercase for all tag names (except for the <!DOCTYPE> one -- not a "real" Html tag)
- Use spaces in your JS code (and <script> tag doesnt require attributes in Html5 (there's only JS available)
- Benefit of code playground tabs features and put your JS code in the dedicated one (also for CSS in its own dedicated tag -- they are silently linked to the head section)
- Don't use 'align' attribute and most of all html attributes and tags related to styling, rather use Css
- Prefer declare explicitly your JS variables, rather than let them been implicitly declared (use keyword 'var' once before each variable name in each variable scope (actually you're implicitly use only global vars, even they are use inside your functions... it doesn't really matter in this case, but could frequently be source of problems ^^)
Fixed and indented code (minimal spaced/lines breaked JS; not 'style' tag: avoided as only one rule, so inlined with 'style' attribute but avoid it use -- to reserv to JS access):
https://code.sololearn.com/WQFMap79IfF7/?ref=app
+ 4
Quite good idea of implementation :)
However, 'eval()' function is considerated unsafe as could be roundabout by user... So, you can make it a few safer by disabling your text fiel answer <input> (<input disabled ...>), or use another non-editable container element as generic <div>, and rather use of 'value' attribute, use 'innerHTML' one, or simply 'textContent' one in case of raw text update without requiring Html parsing ^^
https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent
+ 4
@rishita:
As you've posted here by error and reposted in the right thread, you can now delete your post from here ^^
+ 3
Nice code. You can also have a look into this one
https://code.sololearn.com/W110GUL9VrfS/?ref=app
+ 3
@Ňıþhįwæţ ß.:
He say in his thread that he had written it himself, without << consult any previous presentation before making my work >> ^^
+ 3
i made one too
https://code.sololearn.com/W5NguCieJgrF/?ref=app
dont judge from the date
its uploaded for over two months
+ 2
This calculator seems familiar 🤔
+ 2
I don't have been, I'm not and and probably will never be a Facebook member ;P
+ 2
cool, i need learn to make it
+ 2
https://code.sololearn.com/WfYg1BOHNqh4/?ref=app
https://www.sololearn.com/Discuss/472675/?ref=app
^^
Same source?
It would be fairplay to quote original one :P
+ 2
i fixed the errors
+ 2
god damn thanks
+ 1
I've created an operating system xD
+ 1
Please be my friend on Facebook.
m.facebook.com/Oly.Mahmud38