Using the following jQuery script get the current loading URL Jquery -: var href = jQuery(location).attr(‘href’); Javascript-: var href = window.location.pathname; jQuery(document).ready(function() { setTimeout(function() { window.location.href = href; }, 3000); });
Tag: jQuery
add css style using jQuery
Programmers using this technique for dynamic css styling. For Example: jQuery(“#smarttips.in-email”).css(“border-color”, “#C00”);
How to download or print a page using PHP and javascript
jQuery(‘.payment-print’).live(‘click’, function() { var sUrl = jQuery(‘#base-url’).val() + ‘/jobs/paymentprint/id/’ + jQuery(this ).attr(“id”); jQuery.post(sUrl, function(data){ var HTML = data; var WindowObject = window.open(” “, “PrintWindow”, “width=769,height=601,top=40,left=40,toolbars=no”); WindowObject.document.writeln(HTML); WindowObject.document.close(); WindowObject.focus(); WindowObject.print(); WindowObject.close(); }) });
How can I disable a button in a jQuery
disable a button in a jQuery jQuery(“#a-create-event”).attr(“disabled”, true); Enable a disabled button in jQuery jQuery(“#a-create-event”).attr(“disabled”, false);
jQuery Validation of login by pressing enter key
Validate login by pressing enter key $(“#username, #password”).keydown(function(event) { // track enter key var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); if ( keycode == 13) { // key code for enter key // force the keyboard ‘Enter Key’ to implicitly click the Update button validateLogin(); return false; } else …