Disable in the whole document from copy,ctrl+u and right click. <!– Disable ctrl+u & ctrl+c and prevent Right Click –> <script type=”text/javascript” src=”http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js”></script> <script type=”text/javascript”> …
Read MoreJavaScript
How to avoid conflicts of jquery library
Use This Code To Avoid Conflicts Of Jquery Library Files.. $.noConflict(); As Example: var jq = $.noConflict(); jq(document).ready(function(){ jq(“button”).click(function(){ jq(“p”).text(“jQuery is still working!”); …
Read Morehow to print using javascript
<button onclick=”window.print();”> Print </button> use this code window.print(); It will print full opened window.
Read Morehow to print a Div content in javascript
By using this script we can print the content of a Div. It is working fine. We have to call this script like this: <button …
Read MoreHow to print a div content
<html> <head></head> <body> <style> .AP_CONTNT{width: 1000px;} .AP_HEAD{border: 1px solid;padding: 7px;background: bisque;} .AP_CONTNT1{border: 1px solid;padding: 7px;margin-top: 5px;background-color: cadetblue;} .AP_CONTNT2{border: 1px solid;padding: 7px;margin-top: 5px;background-color: cadetblue;} .AP_CONTNT2_B1{border: 1px …
Read MoreHow to restrict input box to take only numbers
<input type=”text” name=”card_num” size=”4″ maxlength=”4″ onkeyup=”return isNumberKey(this);”> <script> function isNumberKey(e) { var numberRegex = /^[0-9]+$/; if(!numberRegex.test(e.value)) { e.value = e.value.replace(/\D/g, ”); } } </script>
Read MoreHow to load an error image when image not loaded
<img src=”../product_image.jpg” alt=”Image not found” onError=”this.onerror=null; this.src=’../empty/blank.gif’;”/> this will solve the problem
Read Morehow to get direct child of an element in jquery
Get the direct children of an element UL. $(document).ready(function() { $(“ul”).children().css({“color”: “red”, “border”: “2px solid blue”}); });
Read MoreFind an element using jquery
finds tag/class/id the table/page Using Jquery <script> $(document).ready(function() { $(“.table”).find(“span”).css({“color”:”blue”}); }); </script>
Read MoreHow to find an element or tag using Jquery
The HTML is here: <table class=”table”> <caption>My testing Table</caption> <tr> <td class=””><span>data-1</span></td> <td>data-2</td> </tr> <tr> <td>data-3</td> <td><span>data-4</span></td> </tr> </table> The Script is: // ONLINE JQUERY …
Read More