Solved

Magento and JQuery(AJAX)

Posted on 2009-07-10
4
3,944 Views
Last Modified: 2013-12-13
I am working on magento site, where I would like to use JQuery and AJAX as possible. I am using specific layout which is suitable for this.
Has anyone experience with Magento with JQuery (or AJAX in frontend) ? How much support is in Magento for AJAX / JSON? I mean frontend, not backend.
One way to implement ajax in frontend is learn from backend, and then try to do likewise.
I want some ajax api, for example ajax controller (something like zend ajaxController) which returns product info in JSON for some product ID etc.
      
In other words, is there something like "magento AJAX api" ?

Thanks for any suggestions
0
Comment
Question by:Michal-Drozd
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
fibo earned 500 total points
ID: 24827643
Hi Michal,

1 - Magento is using heavily javascript and Ajax both on front and back-end usually with scriptaculous/ prototype.

2 - Adding jQuery is possible, but you need to take care of interferences with the other libs.
You will find a complete explanation / example at
http://css-tricks.com/using-jquery-in-magneto/ (yes there is a typo... but this is really the link)

3 - A final note: in Magento you can "consolidate" most of the js files. This is an option you select in the site configuration.
BUT be aware that it works thru a php file and that create 2 problem /constraints:
a - the js can be consolidated only if they are under /js/
b- during Magento updates (once a month) the file /js/index.php maybe overwritten and get its ACCESS RIGHTS CHANGED to chmod 666 instead of 644... most host providers will refuse to run a php scripts with chmod 666, and you will be checking why your site does not work anymore...
0
 
LVL 29

Expert Comment

by:fibo
ID: 25010911
AngelIII,
I believe my answer was relevant and useful.
I leave to Michal or you to evaluate this.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question