Trivial problem while making Ajax call across domains.

I had just started understanding Ajax through jQuery using JSON. jQuery support to Ajax and JSON is awesome. I was stuck at a point where I had to make ajax call from my php application to java application. JSON seems to be the ideal solution for this, however a normal $.getJSON() method does not work as expected in case of cross domains calls.

Over the net, you will find that you need to write your own jquery function in such scenario. You may find sample codes as well. Forget it!!! JSON-P (’P’ stands for padding) does the magic.

In my next posts, I will discuss more about JSON and JSON-P, and how to make cross domain ajax calls!!!

JQuery
Posted on December 11, 2008

Running Jquery with other JS frameworks, like mootools

Generally, people face problem running mootools and jquery simultaneously.
Here is a simple way to perform the task:

SCRIPT CODE:
<code>
jQuery.noConflict();
jQuery.(’#ids’).hide(’slow’);
</code>

HTML CODE:
<code>
&lt;div id=’ids’&gt;Algoworks&lt;/div&gt;
</code>

If you think, that you didn’t faced error.
Just to see, in which condition moootools stops working
1. include mootools.js
2. jquery.js
And, check for JS Errors.

Why does occurs?
This all happens due to naming.
Both the JS Frameworks uses same Object named ‘<strong>$</strong>’ to Refer.
Now our script will get ambiguity in referring the object.