What can javascript do client side with ecommerce? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What can javascript do client side with ecommerce?

I was wondering what client side javascript is capable of in ecommerce? Csn it make a shopping cart? Can it add things to the shopping cart from another page? What other things can it do? I was wondering cause ive run into a rode block of not being able to build projects i want with just frontend knowledge.

19th Nov 2018, 1:22 AM
Brittany Brown
1 Answer
+ 1
JavaScript on client-side is mainly used to animate, verification (not recommended) and XML http request, commonly known as AJAX, which lets you interact with server-side scripts. This is used a lot for example, on search bars which show suggestions with images or prices as you type in. So yes, you could add things to a shopping cart without changing pages. lets say we have: getArticle.php: this file takes an id, and returns data of the article with that id Normally to get that data, you have to enter to that specific file. With AJAX, you just call a function, which ejecutes the file, and so you get the data without changing pages. What you do with that data is up to the developer to decide
19th Nov 2018, 2:14 AM
voidneo