I found a excellent article about creating a drop down menu using jQuery written by Abhishek Bhardwaj. For simplicity, i merge the .js file and the .html into one file.
Continue reading jQuery – Simple Dropdown Menu
Tag 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 – Get URL Query String
We could also get the URL query string in jQuery. Continue reading jQuery – Get URL Query String
jQuery – unwrap
As of jQuery 1.4, you can unwrap an element with the unwrap() function. Prior to jQuery 1.4, you can unwrap a specific element by Continue reading jQuery – unwrap
jQuery – Bind event to newly inserted element
If you have inserted DOM objects into the HTML in $(document).ready(function() {…}). Those binded events will not applied to newly inserted DOM objects. In the following example, a new button is inserted whenever the .btn is clicked. but it is only valid for the first .btn button. Continue reading jQuery – Bind event to newly inserted element
jQuery – Check/Select a radio input
The following jQuery code check/select a radio button.
$('#radio-input-id').attr('checked', 'checked');
Done =)