+ 2
I have errors in my JS part.
I have errors in my JS part, can someone check my code and tell me what changes must I do ? My project : https://code.sololearn.com/W01KYK017LSt/?ref=app
7 Respuestas
+ 5
your problem is: the function change_quantity is inside the function change_product, so you can't call it just by its name
I would suggest you to rewrite your javascript, and make every function separate, it's not a good idea to put functions inside other functions, however if you do the you need to use the word 'new' and every function and/or variable needs to be initialized with 'this'
for example:
this.var = 5;
this.funcName = function (){}
hope this helps
+ 4
No problem!! (if you pay me well 😂😂)
+ 3
Thank you, I understand now ^^ oups fail LOL, Thann you for your advises Kamil :)
+ 3
I've just fixed the problem thanks to you Kamil, I enjoy jour advises, Thanks :)
+ 2
It's not showing any errors🤔
+ 2
Press a buy button, an overlay will appear, and select a quantity different from 1, an error will appear, and I don't know how to correct it.
+ 2
At the end I want to display the final price the user has to pay ( product's price * quantity ) but there is an error line 32 in JS, and I would like to correct this error before finishing the rest.