Solved

Magento and JQuery(AJAX)

Posted on 2009-07-10
4
3,936 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now