JQuery Hint Tutorials

Url Parsing In Jquery

Get Url(domain) parameter using jquery function.In below code, I wrote one function called getUrlVars().Using this function you can get requesting parameter value.If parameter not found., It will return undefined responseIt was working for me good. var ID= getUrlVars()["id"]; if(ID==undefined){ ID=''; } function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } OUTPUT Url:http://mydomain.com/index.php?id=1 In js: var ID= getUrlVars()["id"]; Output ID=1 […]... Read More »

Jquery Checkbox Event Handling

$('#buttonid :checkbox').click(function() { var $this = $(this); // $this will contain a reference to the checkbox if ($this.is(':checked')) { // the checkbox was checked } else { // the checkbox was unchecked } });... Read More »