jQuery event.data object and .data() method
We usually use the following function to bind an event handler to a jQuery object on some event: $( “button” ).on(“click”, function(event){}); The .on method actually has another form: $( […]
We usually use the following function to bind an event handler to a jQuery object on some event: $( “button” ).on(“click”, function(event){}); The .on method actually has another form: $( […]
We’ve talked about simulating mouse click in C language. Today, we’ll learn how to simulate mouse click in jQuery. There seem quite a few methods to simulate a mouse click […]
I’ve been looking for the javascript sleep function for a long time. Unfortunately, although most programming languages such as C/C++, php, python, etc. have a sleep function, javascript has neither […]
I often got confused about JSON and JSON string. JSON is the code you write in your javascript script to represent an object, so the code is called JavaScript Object […]
Some stupid websites may use javascript to disable copy/paste. You can not select the text on their website. You can not use Ctrl C to copy content from the webpage. […]
I often got confused by different usages of the setTimeout function. I do not know where I got the following usage, which is proven not the correct usage: setTimeout(“alert(‘hello world’)”,1000); […]
I love php array because the array’s key can not only be number but also be string. $arr=array(“a”,”b”,”c”); $arr=[“a”,”b”,”c”]; $arr=array(“k1″=>”a”,”k2″=>”b”,”k3″=>”c”); $arr=[“k1″=>”a”,”k2″=>”b”,”k3″=>”c”]; That makes it an association array or a […]
Javascript does not allow multi -line string constant. var html=’ <div> <span> hello world</span> </div> ‘; alert(html); This will produce an error:”unterminated string literal“. To write multi-line string, you have […]
The Date object looks simple. It has methods to get the date, month, year, hour,minute, second that it represents. And it has methods to set these values. But it has […]
I thought the jQuery library must have supported the calendar/date time picker UI because it is such a basic and frequently used control like button or input box. But I’m […]