Difference between .click() vs .bind() vs .live()

Difference between .click() and .bind() .click() is itself a event which will perform some task in function $(“blah”).click( function() { alert( “Click!” ); } ); .bind() is use to bind multiple event with single id or tag $(“blah”).bind( “click mouseover mousedown”, function() { alert( “Click!” ); } ); Difference between bind() and live() bind() .bind()…

Continue reading

Simplify Ajax development with jQuery

jQuery, the JavaScript library provides some powerful set of jQuery AJAX API’s to handle AJAX requests. The normal way of making AJAX calls using JavaScript is a bit odd as you have to first create an XMLHttpRequest object that depends on the browser and then make an AJAX call. Also sending a form data using…

Continue reading

use jquery as :last-child is not supported by IE8

IE8 not support :last-child so use jquery as alternative Use jquery to get last child and set css using jquery. /*As :last-child css is not supporteed by IE8 so to overcome we use this jquery script*/ $(document).ready(function () { $(‘.crumb ul’).children().last().find(‘.crumb-item-right’).css(‘background’, ‘none’); });

Continue reading

Show Partial view as popup with Actionlink

use Jquery dialog to open the partial view as popup. Change in View: //add class to action link and get the actionlink click using .classname in jquery. @Html.ActionLink(“link text”, “actionName”, “controllerName”,  new {@class=”popupLink”}) <script type=”text/javascript”> $(function () { $(‘.popupLink’).click(function () { $(‘<div id=”popupfooterdiv”/>’).appendTo(‘body’).dialog({ close: function (event, ui) { dialog.remove(); }, modal: false, draggable: false, width:…

Continue reading

Jquery to check only one radio button among two radioButtonList

$(document).ready(function () {                 $(‘form’).delegate(‘.radiogroup :radio’, ‘click’, function () {            $parent = $(this).closest(‘.radiogroup’);             $(‘:radio’, $parent).attr(‘checked’, false);            $(this).attr(‘checked’, true);        });    });   form==> <form>.radiogroup==> Parent Div of the Both RadioButtonList:radio ==> type=”radio”

Continue reading