Technology

Smart way of focussing a text input on page load for heavy pages

Let's say you have a login page which contains a form with username and password field in it (offcourse, along with a submit button). Let's say being much focussed towards user convenience with the user interface, you want to put the cursor in the username field of your form as soon as the page loads. You just go ahead and write- ...

by raj
Tag: jquery
27-Aug-2012

Technology

Replace All using JQuery and Regex

I recently found out that use of Regex with jQuery and replace function can turn out to be a very powerful tool for replacing/loading data in html dynamically The use of replace is made like [js] var a = "Some text here text"; a=a.replace(/text/g,"one") [/js] This will replace all "text" with "one" Now...

by Gaurav Sharma
Tag: jquery
24-Aug-2012

Technology

JQuery : create URL query string from JSON/Array

Hi Friends, I was writing javascript to reload my page with different parameters. So I needed to create the queryString of those parameters but I didn't want to create it of my own. I already knew about jQuery.serialize() which serializes the form and creates the queryString, but unfortunately I didn't have form. So that gave me...

by Amit Jain
Tag: jquery
04-May-2011

Grails

File Uploading using plupload plugin of jquery.

In my grails project i was having the requirement of having multiple file uploading, but in current implementation there was the problem of button being not loaded in Internet Explorer.For that i found plupload very cool to implement this. It has very cool feature of drag and drop and support for almost all browser. Actually what it does...

by Anuj Aneja
Tag: jquery
14-Feb-2011

Grails

JQuery script to put focus on first field of any page

Hi, In my recent grails project, i needed to put focus on the first field of any page whenever the page loads. The requirement is such that if the page contains errors then the focus should be on the first input field which has errors. I searched a lot and with the help of my colleague we came out with a simple JQuery script to put...

by Vishal Sahu
Tag: jquery
13-Jan-2011

Technology

Jquery : map and grep functions

Hi friends, I was going through some utility funcitons being provided by jQuery. Found few methods like grep, map very userful that saves me from writing loops. I could relate them with grep, collect respectively as provided by Groovy, thought would share with you. I will be taking examples with JSON objects say Student. grep() ...

by Amit Jain
Tag: jquery
15-Nov-2010

Technology

Asynchronous behavior of AJAX

Ajax (shorthand for Asynchronous JavaScript and XML) is used to retrieve data from the server asynchronously without interfering with the display and behavior of the existing page. Forgetting this asynchronous behavior will produce incorrect result if it depends on the response from Ajax call. Lets take an example(I am using JQuery to...

by Bhagwat Kumar
Tag: jquery
14-Sep-2010

Technology

jQuery: Floating message box which disappears in few seconds

Hi Friends, Recently in one of the project I was working on, had a long web page and updates used to happen only through ajax calls that means no page refresh. The status messages used to appear on the top of the page, the user had no way but to scroll up to see the status message. There we thought of using floating message that always...

by Amit Jain
Tag: jquery
14-Sep-2010

Technology

jQuery Alert Message without using traditional javascript alert-box.

This post might help you if you want to display alert messages without using tradition javascript (irritating) alert. To achieve this you need jQuery for your frontend UI. Below is the javascript method (code snapshot) which displays your message for 5 seconds. And then fades out automatically. function displayAlertMessage(message)...

by Salil
Tag: jquery
14-Jun-2010

Technology

JQuery: Send JSON Objects with an Ajax Request

Through my blog, I will discuss about sending JSON objects with ajax request using JQuery. We have number of functions in jQuery to kick-off an ajax request. But for sending JSON objects along with the request, I chose jQuer.ajax(). It takes various parameters url, type, data, dataType, beforeSend etc. Its API can be found here. Lets...

by Amit Jain
Tag: jquery
11-Jun-2010

Technology

jQuery : Chaining of your custom function calls

Hi Friends, I always used to think how jQuery provides the chaining mechanism, must be something really complex so never cared to find it out. Though there was a desire to to use the same concept in my own custom javascript functions. Recently I realised how easy it is, so thought would share with you with the help of an example. ...

by Amit Jain
Tag: jquery
04-Jun-2010

Technology

Monitoring ajax call response

Recently I have faced a problem of monitoring all the ajax calls. Based on the response from server I have to perform some task depending on the contents of response. If the html response contains some text input field, the first text input field should be automatically focused otherwise leave the response as it is. Here is the...

by Bhagwat Kumar
Tag: jquery
04-Mar-2010