- news (280)
- links (278)
- jQuery Plugins (39)
- plugins (17)
- jQuery News (13)
- Media (13)
- jQuery and JavaScript (13)
- jQuery Code Snippets (12)
- jQuery and CSS (10)
- jQuery Mobile (10)
- jQuery Utilities (9)
- jQuery Functions (8)
- jQuery (7)
- Uncategorized (7)
- images (7)
- jQuery and Ajax (7)
- Random jQuery Stuff (6)
- jQuery and WordPress (6)
- jQuery Testing (6)
- jQuery Articles (6)
- Jquery Editors (5)
- Jquery Tools (5)
- jQuery Image Scripts (5)
- jQuery and HTML (5)
- jQuery Events (5)
- Sequence.js - The jQuery Slider Plugin with Infinite Style
- SIDEWAYS jQuery fullscreen image gallery
- pjax
- Commonly Confused Bits Of jQuery - Smashing Magazine
- jQuery content slider carousel image slideshow | bxSlider
- Colors: JS Color Library :: Matthew B. Jordan
- jQuery.post() – jQuery API
- Accordion with CSS3 | Codrops
- jQuery Smooth Scrolling Plugin | Page Scroller
- Better background images for responsive web design » Blog » Elliot Jay Stocks
- Building a parallax scrolling storytelling framework | Tutorial | .net magazine
- danmillar/jquery-anystretch - GitHub
- Simple jQuery Mobile Site with Google Maps API V3 | davidjwatts.com
- jQuery Automatic Geocoder
- Five Useful Interactive CSS/jQuery Techniques Deconstructed - Smashing Magazine
- Using jQuery, Plugins and UI Controls With Backbone | ThoughtStream.new :derick_bailey
- Moment.js - The Missing Javascript Date Library
- demosthenes.info – Goodbye, JQuery Validation: HTML5 Form Errors With CSS3
- 10 Best Mobile Web jQuery And HTML5 Frameworks | Web Insight Lab
- 20 Latest CSS3 and HTML5 Resources and Tools for Web Developers
- Stop paying your jQuery tax
- jQuery HTML5 Fullscreen Slideshow / Gallery
- Sequence.js - The jQuery Slider Plugin with Infinite Style
- Escapes.js
- 8 jQuery Image Sliders with Impressive Transition Effects | Queness
$.getScript mutiple scripts
This is very useful for loading mutiple scripts with a callback function containing code that you want to run only when all of the scripts have been loaded. To load mutiple scripts you need to enhance the AJAX $.getScript() function to handle mutiple scripts then simply add them to an array for the first parameter [...]
How to Setup A Simple AJAX Loading Image

This is how you can display a simple loading image while your AJAX requests are being processed. Using the .ajaxStart() and .ajaxStop() functions will ensure the loading image is displayed for all AJAX requests fired off on the web page.
View Demo
The Code
<script type="text/javascript">
$(document).ready(function () {
$('#loading')
.hide()
.ajaxStart(function() {
$(this).show();
})
.ajaxStop(function() {
$(this).hide();
});
});
</script>
The Loading Image

You can also create your own animated GIF using Online AJAX Image Tools.
CSS Only Version
This is the CSS to setup a CSS loading image while your AJAX request is loading.
#loading {
position:fixed;
top:0px;
right:50%;
background:#fff;
width:60px;
height:20px;
padding:0px;
padding:4px;
-moz-border-radius-topleft: 0px;
-moz-border-radius-topright: 0px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
-webkit-box-shadow: 3px 3px 3px #0a0a0a;
-moz-box-shadow: 3px 3px 3px #0a0a0a;
box-shadow: 3px 3px 3px #0a0a0a;
border-right-width: 2px;
border-bottom-width: 2px;
border-left-width: 2px;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-color: #CCC;
border-bottom-color: #CCC;
border-left-color: #CCC;
z-index: 999999;
}
jQuery AJAX Differences Between GET vs POST
Quite a few people have been asking me the question “what is the difference between GET and POST when I am specifying an AJAX request?”. These are the key differences between GET and POST when you are specifying an AJAX request using jQuery.
Related posts:
GET vs POST
- A GET request is used to get data from the server.
- A POST request is used for modifying data on the server.
When to use GET
If the processing of a form is idempotent (i.e. it has no lasting observable effect on the state of the world), then the form method should be GET. Many database searches have no visible side-effects and make ideal applications of query forms.
- Use GET for safe actions and POST for unsafe actions.
Characteristics of GET:
- GET requests can be cached
- GET requests can remain in the browser history
- GET requests can be bookmarked
- GET requests can be distributed & shared
- GET requests can be hacked
When to use POST
If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.
- Use POST when dealing with long requests – if you’re sending large amounts of data, or sensitive data over HTTPS, you will want to use POST. Some browser such as Internet Explorer place a limit on the URL string so this may break the action of some forms if you use GET.
You may consider using POST for the following actions:
- Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles
- Providing a block of data, such as the result of submitting a form, to a data-handling process
- Extending a database through an append operation
- Annotation of existing resources
GET vs POST in AJAX calls
Unless you are sending sensitive data to the server or calling scripts which are processing data on the server it is more common to use GET for AJAX calls. This is because when using XMLHttpRequest browsers implement POST as a two-step process (sending the headers first and then the data). This means that GET requests are more responsive – something you need in AJAX environments! Because “Ajax” requests are subject to the same origin policy there is limited security risks when using GET instead of POST. Use GET to “GET” information from the server such as loading a JavaScript file (AJAX shorthand function $.getScript() can be used to do this) or loading a JSON file (AJAX shorthand function $.getJSON() can be used to do this).
jQuery AJAX Functions that use GET as default: $.get(), $.getScript(), $.getJSON(), .load()
jQuery AJAX Functions that use POST as default: $.post()
Example GET AJAX Call – Calling a PHP script to get the number of twitter followers.
$.ajax({
url: 'getTwitterFollowers.php',
type: 'GET',
data: 'twitterUsername=jquery4u',
success: function(data) {
//called when successful
$('#ajaxphp-results').html(data);
},
error: function(e) {
//called when there is an error
//console.log(e.message);
}
});
Example POST AJAX Call – Submitting a login form.
var $form = $("#myForm");
var url = $form.attr("action") + "?" + $form.serialize();
$("#" + id).html(url);
$.ajax({
type: "POST",
url: action,
data: $form,
success: function(response)
{
if(response == 'success')
$("#myForm").slideUp('slow', function() {
$("#msg").html("<p class='success'>You have logged in successfully!</p>");
});
else
$("#msg").html("<p class='error'>Invalid username and/or password.</p>");
}
});
Further Readings
Form Submission Example
This example doesn’t really apply to AJAX as these requests happen behind the scenes but may help you understand further what is happening between the different request types.
When using GET a HTTP request is generated and passes the data to the web server as a set of encoded parameters appended to the URL in a query string.
For instance, it would be a bad idea to use GET for a login form submission as the login details would show in the address bar.
GET /login.php?username=user&password=12345 HTTP/1.1 Host: domain.com
But if we used POST the parameters would be passed within the body of the HTTP request, not in the URL. This would happen behind the scenes between the browser and the web server.
POST /login.php HTTP/1.1 Host: domain.com username=user&password=12345
GET Caching
GET is intended to be used when you are reading information to display on the page. Browsers will cache the result from a GET request and if the same GET request is made again then they will display the cached result rather than rerunning the entire request.
REST – The “RESTful” Client Server Architecture
HTTP, for example, has a very rich vocabulary in terms of verbs (or “methods”), URIs, Internet media types, request and response codes, etc. REST uses these existing features of the HTTP protocol, and thus allows existing layered proxy and gateway components to perform additional functions on the network such as HTTP caching and security enforcement.
Read about “Representational State Transfer” (REST): http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_example:_the_World_Wide_Web
REST – The “RESTful” Web Services (API)
It is a collection of resources, with four defined aspects:
the base URI for the web service, such as http://example.com/resources/
the Internet media type of the data supported by the web service. This is often JSON, XML or YAML but can be any other valid Internet media type.
the set of operations supported by the web service using HTTP methods (e.g., POST, GET, PUT or DELETE).
The API must be hypertext driven.[11]
http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services
Conclusion
Well I hope that you have a clear idea of when to use GET and when to use POST. If your still unsure or want to inspect what’s happening behind the scenes of your AJAX calls use a tool like Firebug NET Panel to see where your data is being sent (such as in the header) the type of request. Other than that, happy Ajax’ing!
5 Online Loading AJAX Spinner Generator Tools
In this post, we’ve collected 10 free online Loading AJAX Spinner Generator Tools to make your own custom AJAX loaders. Easy to create your own simply
- Select your spinner type
- Choose your colour
- Choose your animation speed
- Click create
You can also create your own images and use them as loading gif animations, see 10 Online Custom GIF Maker Tools. Enjoy.
1. CSS Load Online Tool
cssload.net is a standard online tool for generating your own Ajax spinner. It has a live preview which is nice and animation speed controls. The primary and secondary colour options give it something special the other tools don’t have or use very well. The beauty of this tool is that it will generate the CSS for you to create a CSS only spinner instead of saving as an image.
2. Ajax Load Online Tool
ajaxload.info does exactly what is says on the tin, creates you an ajax loader in seconds. Limited to the spinners you can choose but it is always reliable and takes seconds to choose and generate your own coloured spinner with transparent background option.
3. Load Info Online Tool
loadinfo.net offers you 132 spinner images straight up and then after choosing one you can change the colors and size up to 48 by 48. The only drawback is it is slightly slower than the other options but still we’re only talking seconds here. Good option.
4. Preloaders Online Tool
preloaders.net is probably my pick of the bunch because it has excellent options for choosing custom images.
5. Spin.js Online Tool
Spin.js is a plugin which can be used to create your own online tool for Ajax Spinners.
10 Online Custom GIF Maker Tools
In this post, we’ve collected 10 free online gif maker tools to make your own custom AJAX loaders. Easy to create your own simply upload your images to create your own custom animations.
Related posts:
1. gifmake.com
composes with (gif,jpeg,png) pictures an animated GIF.Already animated GIF can also be decomposed.
2. gickr.com
Lets you instantly create Animated GIF online, free, right now! Just upload pictures or grab them from your Flickr.
3. makeagif.com
Creates animated gifs online with free gif animator in just three easy steps. Upload, Customize, Create. Note: You will have to sign up first to use this free tool.
4. gifup.com
Your personal GIF animation and avatar generator.
5. createagif.net
Is a free online animated GIF creator that lets you select images on your computer and turn them into GIF animations. The animation size and speed.
6. picasion.com
Creates animated GIF online for free.
7. Animated GIF Maker
Make a GIF free online by uploading your pictures your animated GIF can be used anywhere.
8. Gifninja
Creates and splits an Animated Gif.
9. gifka.com
Your individual GIF animation and avatar creator.
10. How-to-make-GIF.com
Make a GIF animation online for free! Up to 100 pictures. 100% free gif maker.
jQuery.ajax get json code snippet
Just a snippet i use often so thought i would post it for easy access. It basically just grabs a JSON from the same server (remember AJAX only works on the same server, unless you use JSONP or have a Proxy pass in place).
Read more about Ajax and JSON.
(function($) {
$.ajax({
type: 'GET',
url: 'data/data.json',
async: false,
datatype: 'JSON',
success: function(data)
{
if (data)
{
console.log(data);
}
}
});
})(jQuery);
jQuery Undetermined String Literal Error
Have you ever come upon this annoying error message: “undetermined string literal”.

Ok, i’ve got 3 occasions were you might run into this error and how to fix it for each specific case.
- Multiple Line Strings
- Wrong String Format (Bad Characters)
- Angle Brackets
Multiple Line Strings
If your trying to assign a string that covers multiple lines to a variable you might see the “Undetermined String Literal” error. To solve this you must use the JavaScript escape character backslash (“\”) after each line to tell the interpreter where the line ends and to join the string together.
Another way is to simply split your string up into bits and add them together.
Wrong String Format (Bad Characters)
If your trying to assign HTML to a variable you might see the “Undetermined String Literal” error. It might be that you loaded the HTML from somewhere else via ajax and are now trying to use/inspect it. Use the following code to clean up the bad characters in the string before trying to assign it.
Angle Brackets
If your trying to use angle brackets (“>” & “<") within a string you might see the "Undetermined String Literal" error when trying to submit the string data via ajax.
var contentQuery = ‘<securequery consumer="abc" engine="abc" template="abc">first 10 location like "abc"</securequery>’; //note: abc replaces the actual query
It turns out it was the securequery angle brackets creating the error and I had to hack it (as such) by adding in the angle brackets (“<" & ">“) just before encoding and sending the request via AJAX (see below).
$.ajax({
type: 'POST',
url: '/ajax/abc',
data: 'content=' + encodeURIComponent('<'+contentQuery+'>'),
dataType: 'html',
success: function(data){
console.log(data);
//display results
$('#results').html(data);
}
});
This might even be a bug in jQuery, not sure though. When you test in firebug it works though! So maybe not…
var fine = '<securequery consumer="abc" engine="abc" template="abc">first 10 location like "abc"</securequery>'; console.log(fine);
Learn more about jQuery
In today’s post we have included lightbox scripts/plugins from several JavaScript libraries: jQuery, MooTools, Prototype. These stylish lightbox scripts/plugins can ...
Just like Google Translate, jQuery plugins can be used to the same effect when it comes to having your own ...
We’re ready for our next round of community input, this time for version 1.8! This is your chance to suggest ...
The jQuery smoothAnchor Function provides you with a lightweight script that can make your in-page anchor links smooth scrolling. There ...
Here in the United States, we’re celebrating Thanksgiving this week. For those of you living elsewhere in the world, it’s ...
We all know that HTML5 is a new web technology led by Apple and it will be the next big ...
Today while we were searching for a decent plugins to share on the blog we stumbled across some jQuery plugins ...
TL;DR The body responsible for overseeing jQuery’s finances and administration, which was until today known as the jQuery Team, is ...
More and more Developers and Designers and have been using WordPress these days. Combining WordPress CMS with the power of ...
Just to let you know we’re not asleep at the switch around jQuery Central, we’ve got a new preview release ...
It seems everyone is asking this question lately! What do these lightbox/thickbox/fancybox/colorbox jQuery plugins have in common and what are ...
We’ve posted tons of jQuery Navigation Menu plugins for your websites and blogs and now we are giving you another ...
It can be very time consuming to make your jQuery code neat and tidy. Fortunately, there are online tools and ...
As a developer you may want to share your code on your website or blog (just like us!). There are ...
Hi guys, just a quick post to show you how to add custom messages to your code snippets that you ...
This is very useful for loading mutiple scripts with a callback function containing code that you want to run only ...
Here are 2 options to quickly view all the JavaScript used on a web page. Could come in handy when ...
This is how you can load the jQuery library using plain JavaScript. As the load takes place asynchronously so i’ve ...
jQuery Summit 2011 It’s that time of the year again (no, not Christmas!, something almost better!) – the annual (online) jQuery ...
The jQuery Slider can play a very important role when it comes to grabbing attention, displaying images & saving space ...
Use jQuery and the Google Maps API to create your own map application.
Super cool and easy way to get stylish tooltips with jQuery.
The right way to include the jQuery library in WordPress.














