javascript

firefox extension console log

When you are debugging your javascript code(so called page script) of your website, you may use console.log to write the value of a variable to console. You can press F12, […]

When browser starts to load a web page, document.readyState===loading. When DOM is constructed, document.readyState==interactive. When page is fully loaded, i.e., the images/css are all loaded, document.readyState===complete. After document.readyState becomes interactive, […]

I have a need to remove multiple lines except the first line in a string. For example, “line1\n\line2\nline3” should be converted to “line1”. At the beginning, I used the following […]

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 […]