Category Archives: jQuery

Drupal – Add Extra jQuery Library

Next: Drupal 7 – Add the latest jQuery on your Drupal 7 without conflicts

The jQuery Update module allows us to update the Drupal 6 core jQuery to 1.3.2. This is definitely not enough for many 3rd party jQuery libraries. If you want to add the latest jQuery without affecting the core script, you can try the following approach which makes use of the jQuery.noConflict() and it is originally written by gala4th in his blog THERE IS NO PLACE LIKE 127.0.0.1.

Ok, now we want to add the new jQuery for a specific content. Let’s follow the custom module we created in Continue reading Drupal – Add Extra jQuery Library

jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP

A few days ago i posted an article about making a JSON request using $.getJSON().
jQuery & JSON – Make JSON GET request using jQuery.getJSON()

But i have made a mistake there because i didn’t realize the Cross Domain problem. So this article shows you how to resolve the Cross Domain issue in $.getJSON() by JSONP. Continue reading jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP

jQuery & JSON – Make JSON POST request using jQuery.post()

We can also make JSON POST request using the jQuery.post() function. If you want to use GET request. please refer to the previous post.
jQuery & JSON – Make JSON GET request using jQuery.getJSON()

 
Update @ 2011-10-13: This example does not work for Cross Domain POST request since the Current jQuery version(1.6.4) does not allow a Cross Domain POST request. For more information, you can refer to Mark Needham – jQuery: $.post, ‘jsonp’ and cross-domain requests

So if you want to make a Cross Domain GET request. Take a look on the following post.
jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP

 
Here is the new server.php Continue reading jQuery & JSON – Make JSON POST request using jQuery.post()

jQuery & JSON – Make JSON GET request using jQuery.getJSON()

The following example makes a HTTP GET request with a JSON input and return the corresponding JSON object.

 
Update @ 2011-10-12: The example here does not support cross domain request. In other words, the server.php and json-get.php have to be inside the same domain. (ex. localhost) Thanks dskanth for pointing out the problem.
jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP

 
Add the following 2 files to your web server
server.php Continue reading jQuery & JSON – Make JSON GET request using jQuery.getJSON()

CSS & jQuery – Hide the HTML page until the Javascript & CSS styles are completely loaded

It always takes some times for the browser to apply the CSS styles on the rendering page. Therefore, users may observe a style leap before the page is completely loaded. We could fix this problem by hiding the body anchor until the Javascript and CSS are loaded.

First, set the visibility of the body anchor to hidden. Continue reading CSS & jQuery – Hide the HTML page until the Javascript & CSS styles are completely loaded

jQuery – Slideshow Example

This is another jQuery example which i want to share with you. Again, it maybe not good for use but it would be a nice example for beginners to take a quick look on jQuery. Try jQuery Cycle Plugin to get more interesting animation. If you are looking for more jQuery examples, take a look in my previous blog posts.

Continue reading jQuery – Slideshow Example