KB

Adding JavaScript to your site

in Design Tags: codingjavascriptliteralliteral tagtag

Adding JavaScript to your site.

The shopping cart requires any JavaScript code to be surrounded by {literal} tags for the JavaScript to work. The {literal} tag tells the smarty engine to ignore any functions between the tags.

Example:

{literal}
alert(“Welcome!”);
{/literal}

2 common methods of having additional, interactive images in your description areas:

<script language=”javascript” type=”text/javascript”>
<!–
function popitup(url) {
newwindow=window.open(url,’name’,’height=200,width=150′);
if (window.focus) {newwindow.focus()}
return false;
} // –></script>

<a realrealsrc=”popupex.html” src=”http://www.pinnaclecart.com/kb/admin/popupex.html” href=”http://www.pinnaclecart.com/kb/admin/popupex.html” onclick=”return popitup(‘popupex.html’)”
>Link to popup</a>

<SCRIPT language=”JavaScript” type=”text/javascript”>
<!– function changeImage() { document.images[“jsbutton”].src= “image_of_multiple_colors.jpg”; return true; }
function changeImageBack() {  document.images[“jsbutton”].src = “original_image.jpg”;  return true; }
function handleMDown() {  document.images[“jsbutton”].src = “optional_image_when_clicked.jpg”;  return true; }
function handleMUp() {  changeImage();  return true; } // –>
</SCRIPT>

<A realrealsrc=”#” src=”http://www.pinnaclecart.com/kb/admin/#” realsrc=”#” href=”http://www.pinnaclecart.com/kb/admin/#” onMouseOver=”return changeImage()” onMouseOut= “return changeImageBack()”
onMouseDown=”return handleMDown()” onMouseUp=”return handleMUp()”><img name=”jsbutton” realrealsrc=”the_First_image_possibly_asking_to_see_other_colors.jpg”  src=”http://www.pinnaclecart.com/kb/admin/the_First_image_possibly_asking_to_see_other_colors.jpg” realsrc=”the_First_image_possibly_asking_to_see_other_colors.jpg” src=”http://www.pinnaclecart.com/kb/admin/the_First_image_possibly_asking_to_see_other_colors.jpg” border=”0″ alt=”javascript button”></A>

Release note: Pinnacle Cart uses Smarty templates engine to generate HTML pages. It requires some basic programming skills to edit these files. If you’re unfamiliar with HTML we STRONGLY advise against changing any code on your cart as these changes could disable the functions of the cart. Our customer support team cannot support you on any customizations or code changes you make to the application.

 

Related Articles:

How to design your site (with video)

0