jQuery
Disable submit button after form submission
<script> $(function(){ $(“.class_of_button”).click(function () { $(“.class_of_button”).attr(“disabled”, true); $(‘#Form_id’).submit(); }); }); </script>
Disable Copy and paste from website
If you do not want your content to be copied from your webpage then you can disable copy and paste from your website using following code. <script> $(‘body’).bind(‘copy paste cut drag drop’, function (e) { e.preventDefault();});$(‘body’).bind(‘copy paste cut drag drop’, function (e) { e.preventDefault();});</script>
Add a “Back To Top” floating button using jQuery
Add this to the bottom of the page. <a href=”#” class=”back-to-top”><span class=”glyphicon glyphicon-arrow-up” aria-hidden=”true”> </span></a> <style> .back-to-top { position: fixed; bottom: 2em; right: 0px; text-decoration: none; color: #000000; background-color: rgba(235, 235, 235, 0.80); font-size: 28px; padding: 1em; display: none; } […]
jQuery : Error: $(document).ready is not a function
Sometimes firebug will throw the following error: jQuery : Error: $(document).ready is not a function This error is because another framework is in conflict with jQuery.Use jQuery(document).ready(function() instead of $(document).ready(function() along with jQuery.noConflict(); For example:Use:<script>jQuery.noConflict();jQuery(document).ready(function(){});</script> instead of: <script>$(document).ready(function(){});</script>
How to remove “jCarousel: No width/height set for items. This will cause an infinite loop. Aborting” meassage?
1. Open jquery.jcarousel.pack.js 2. Seach for the word “alert” 3. Replace “alert” with “isNan”4. Refresh the webpage.