Articles Archive for January 2010
jQuery »
In this article, I will be showing you how you can replace string, div content, and image src value with jQuery.
You can do this by replace() function in jQuery.
jQuery »
You can use jQuery queue() function with setTimeout() function to set some time interval between events in jQuery. Like, you have run one event and wanted the browser to wait for some time to run the next event. At this instance, queue function is very helpful.
Suppose, you wanted an image to fade in and out. You can use fadeIn() and fadeOut() jQuery functions to do so. But when you like to wait for some time between fade in and fade out then you can use the queue() function. Remember that, …
Javascript »
It is very easy to execute some code after a specified time-interval, i.e. setting some time interval between the code. We can use the setTimeout function.
Here is the code:
jQuery »
This article shows how to print array and object on jQuery. You can do it with jQuery.each() function.
jQuery.each() function can be used to iterate over any collection, whether it is a map (JavaScript object) or an array.
jQuery, PHP »
In this article, I will be showing you how to create jQuery AJAX tabs in a very simple and easy way.
View Demo || Download Code
Here, tabs.php contains the php code which contains data to be displayed.
PHP »
Below are the most commonly used php directives. You have to change php.ini file in order to configure php settings. This just means changing these directive’s option and value.
1) short_open_tag = Off
PHP »
We can view the php settings by creating a php file in our web root with the following code:
1 2 3 | <?php phpinfo(); ?> |
Let the name of the file be phpinfo.php
Javascript »
It’s a real headache when you have to work on objects and arrays in Javascript. It would be lot easier to detect elements of the Javascript objects/arrays if we have print_r function in Javascript like we have in PHP.
I googled the web and have found a very efficient print_r Javascript function. Here is the code:-
Magento »
Suppose, you have the product data, i.e. you have a loaded product information stored in a variable named ‘$_product‘. Now, when you type $_product->getManufacturer() , you will get the manufacturer ID. To get the manufacturer name, you have to use the following: $_product->getAttributeText(‘manufacturer’). Below is the complete code:
Get Manufacturer Name and ID from Product
Magento »
Manufacturer is a core product attribute in Magento. This article shows how you can fetch the manufacturer attribute and all it’s option value and id.
Here is the code to list all the option values of manufacturer attribute:
Magento »
You can easily get controller name, action name, router name and module name in any template file or class file.
IN TEMPLATE FILES
Mukesh Chapagain is a graduate of Kathmandu University (Dhulikhel, Nepal) from where he holds a Masters degree in Computer Engineering. Mukesh is a passionate web developer who has keen interest in open source technologies, programming & blogging.