With Javasript and jQuery, we could manipulate images at client side. For example, some images are shown on a mouse hover effect. But if that image is too large, there may be some latency before the image could be rendered. We’d better preload those images to minimize the time delay. Continue reading Javascript – Preload Images When the HTML Page is Loaded
Tag Archives: HTML
CSS – Missing HTML Element in Internet Explorer 7
It’s about the greatest browser, Internet Explorer, again!
In IE7, sometimes i found that some HTML elements are gone. But if i uncheck and recheck any CSS style in Developer Tool, they will return back on the screen. Continue reading CSS – Missing HTML Element in Internet Explorer 7
jQuery – Sort Element
I found a very good example which demonstrate how to sort elements in HTML using jQuery. It is too perfect to make any changes of it. Try it by yourself. But please note that the sort() function only works in jQuery 1.3.2 or above. Continue reading jQuery – Sort Element
CSS – Remove Button Text In Internet Explorer
We can remove the text on a HTML button by adding the text-indent css attribute on the button class. but this does not work in Internet Explorer 7. Continue reading CSS – Remove Button Text In Internet Explorer
Javascript – Negative substr() problem in Internet Explorer
It is very common to extract part of a string in computer programming and there is no exception in Javascript. Here are 2 functions for string extraction
- aString.substr(start, length)
- aString.substring(start, stop)
Continue reading Javascript – Negative substr() problem in Internet Explorer
jQuery – Check if an option is selected in Select Box
The following HTML is an example to check if an option is selected in a select box. Continue reading jQuery – Check if an option is selected in Select Box
PHP – dompdf UTF-8 decode problem
The dompdf is a PHP library which help you to convert HTML into a PDF file. Actually i haven’t tried to implement it by myself but recently, i followed an project which used the dompdf and there is a UTF-8 decoding issue for special character like an Apostrophe. Continue reading PHP – dompdf UTF-8 decode problem
jQuery & Javascript – Capture the Browser or Tab Closed Event
I was working on a WordPress project which i need to clear the PHP session when the browser or browser tab is closed. Although Javascript provides the window.onbeforeunload event but it will be triggered even whenever you leave the website. Finally i got a simple solution from Daniel Melo in StackOverflow. The following code required jQuery and i have included the Google one in the HTML.
In your web root, create the js/check_browser_close.js. Continue reading jQuery & Javascript – Capture the Browser or Tab Closed Event
Ajax – Simple Ajax GET Request
This is another example of implementing simple Ajax GET request. Please refer to Ajax – Simple Ajax POST Request for a POST request. Actually, both of them are quite similar and it is good to try both to get more familiar with the generic Ajax requests.
Let’s start our example now. Continue reading Ajax – Simple Ajax GET Request
HTML – Some Useful Divider Lines
I just realized that the <hr /> divider line is not longer working in wordpress.com. Luckily i find a very good post which has several pieces of HTML codes to add the divider in WordPress post.
Solid Line
<div class="aligncenter" style="width:400px;height:0;border-top:2px solid #FF7500;font-size:0;">-</div>