If you want to create Drop Down Menu without working on the Javascript code, you could consider the Drupal Fusion theme + Drupal Skinr module. Continue reading Drupal – Create a Drop Down Menu
Tag Archives: Javascript
jQuery – Check if a Checkbox is CHECKED
So many “check” in this post title. haha~
You can get the checkbox state by the the following jQuery. Continue reading jQuery – Check if a Checkbox is CHECKED
Javascript – Preload Images When the HTML Page is Loaded
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
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
Javascript – Parse XML
I find a very good blog by Steve Born about parsing XML in Javascript. There are all together 3 different ways to parse XML but not all of them are mutually compatible with all browsers. Continue reading Javascript – Parse XML
Writing Your Own Firefox Plugin
Firefox plugin basically is a Javascript program with XUL – XML User Interface Markup Language. This post will create a simple Firefox plugin which will highlight a specific word in a HTML. The following example is base on the work done by Robert Nyman @ How to develop a Firefox extension. Continue reading Writing Your Own Firefox Plugin
Rails – link_to :delete fails
I have created a delete link in the view to delete an object using link_to in Rails but whenever i click the link it goes to the :show method instead of prompting a Javascript alert box for delete confirmation. Here is the code in the view. Continue reading Rails – link_to :delete fails
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
Javascript – Sleep Function
There is no sleep()/wait() function in Javascript. The setTimeout() is not exactly a sleep()/wait() function as it behaves like creating another thread for the scheduled task.
By Google, i got a manual sleep()/wait() function. Try the following code. Continue reading Javascript – Sleep Function