eg :
var str = new Array(“First element”, “Second”, “Last”);
alert(str.length) //will return the number of elements in an array
eg :
var str = new Array(“First element”, “Second”, “Last”);
alert(str.length) //will return the number of elements in an array
You can compare two strings using “==” operator
eg :
var str1=”Test1″;
var str2=”Test2″;
if(str1=str2)
alert(“Message”);
You can declare an array using the constructor “Array”
var arlene1 = new Array();
var arlene2 = new Array(“First element”, “Second”, “Last”)
You can change the class name using the below given code.
document.getElementById(“idElement”).setAttribute(“class”,”className”);
The below given code will display the the content added in “newPage.phtml”
{{block type=”core/template” name=”list-categories” template=”catalog/category/newPage.phtml”}}
<?php
//The following code will load the block with the given "identifier"
// on the phtml page
echo $this->getLayout()->createBlock('cms/block')->
setBlockId('identifier')->toHtml()
?>
To give image path you can use {{skin url=’yourimage.gif’}} .
You can use the following function to get site urls .
Below given are the function with different arguments
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) – http://magesite.extension/js/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) – http://magesite.extension/index.php/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) – http://magesite.extension/media/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) – http://magesite.extension/skin/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) -http://magesite.extension/
$currentUrl = $this->helper('core/url')->getCurrentUrl(); // Displays URL of the current page
Please include the following line in page.xml page to include js file from the your theme folder
<action method=”addItem”><type>skin_js</type>filename.js</action>
The path will be www.yourSiteName.com/skin/frontend/mind/extreme/js/filename.js
Please include the following line in page.xml page to include js file from the your theme folder
<action method=”addItem”><type>skin_js</type><script>filename.js</script></action>
The path will be www.yourSiteName.com/skin/frontend/mind/extreme/js/filename.js