Skip to main content

Posts

Showing posts with the label jQuery

Cool solution for Cross domain

Just follow these steps to make it work: Compose your response as an JSON let say responseObject variable represent this JSON string/object Wrap the JSON response as an argument to a method call e.g. helloMethod (responseObject); where helloMethod is the method name Define this method( helloMethod ) which handles this response in the client side Lets take complete working sample: assume JSON Object as str = {"user":{"fname":"subodh","lname":"gupta","type":"blog","category":"tech"}} handleUser(str); function handleUser(str){ alert(str.user.fname);} just to complete the solution look at call below: jQuery.getJSON("http://subodh.blog.com/servlet?user=subodh&responseType=JSON", function(str) {     alert(str.user.fname); }); Look at this link for details jQuery.getJSON . http://subodh.blog.com/servlet?user=subodh&responseType=JSON this could be replaced by your serv...

Prototype and jQuery together…

How to make prototype.js and jquery.js work together….? Answer is in fact very simple and indeed jquery did it all for you already following is the code snippet on how to do it: <script src=”.../prototype.js></script> <script src=”.../jquery.js></script> <script>jQuery.noConflict();</script> and replace your $ of jQuery with jQuery that it guys you are good to go :)

flXHR and JQuery IE 7 crash

I am using the cross domain flXHR solution with jQuery well initially it was a headache to implement but once done it was on auto pilot seems liked a gem until recently when i got the blocker of IE7 crash on windows XP. The problem seems to be caused by swfobject.js and putting it before jquery declaration will solve the problem:             <script type="text/javascript" src="/flXHR/swfobject.js"/>             <script type="text/javascript" src="/flXHR/flXHR.js"/>