+ 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.
1 Resposta
+ 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