Cross Domain Ajax using Prototype.js and Ajax Extended
Filed Under (Lessons, Tutorials) by admin on 14-02-2006
This is a quick guide to building cross domain Ajax applications using Prototype.js and Ajax Extended. First thing you will need to do is download the two needed libraries.
- Prototype.js
- http://prototype.conio.net/
- Ajax Extended
- http://ajaxextended.com/
First thing we need to do is modify prototype.js to use the Ajax Extended XMLHTTP object rather than Javascript’s native one.
Prototype.js
[code]getTransport: function() {
return Try.these(
function() {return new ActiveXObject(’Msxml2.XMLHTTP’)},
function() {return new ActiveXObject(’Microsoft.XMLHTTP’)},
function() {return new XMLHttpRequest()}
) || false;
},[/code]
Needs to be changed to:
[code]getTransport: function() {
return xmlhttp = new XMLHTTP();
},[/code]
You can now use cross domain Ajax using prototype.js while keeping all the functionality of prototype.js. Make sure you upload the Ajax Extended files and that you configue the Javascript file to point to your PHP file.
Watch AjaxLessons.com for a full tutorial on cross domain Ajax this week.










First this we need to do is modify
could be edited to read
First thing we need to do…
OR
First we need to modify…
The programming is all Geek to me, but good luck on your site!
dddd
yes
Where can I find full tutorial for detail?
Full info here:
http://eng.professionalconsulting.ru/lab/ajaxextended/
@Tez, you can read more about it here.
Since jQuery is getting more and more popular this days, I would like to share an article called “Cross Domain AJAX Querying with jQuery“. It exaplain how to achive XSS using jQuery javascript library.
I hope others will find it useful as well.