Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

javascript help


yaoi

Recommended Posts

hi im new at these stuff, just know some basic html.

 

i have a problem here and hoping for some assistance. im using osc2.2ms2 and want to add a javascript to a box at column_left. its an external javascript that will be called from a link inside an exisiting box which users can click on, and which i want to call from inside php. anyone knows how to do it?

 

its actually a javascript i found for adding to favourites for most popular browsers, as the existing osC contributions only allow for IE. thanks in advance!

Link to comment
Share on other sites

just add another box with the jscript code within the array you pass to the box class.

 

		  <tr>
		<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_JSCRIPT);
new infoBoxHeading($info_box_contents);

$info_box_contents = array();


$info_box_contents[] = array('align' => 'center',
							 'text' => 'Add your jscript code here'
							);

new infoBox($info_box_contents);
?>
		</td>
	  </tr>

 

Make sure you escape single quotes.

Link to comment
Share on other sites

hi and thanks for the reply. i think i was unclear before about what i wanted to do.

 

<script language=JavaScript src="add_bookmark.js"></SCRIPT>

<p id="addBookmarkContainer"></p>

 

 

this is the code i want to add inside an existing box(information.php) so that it can call the external javascript directly when user clicks on the link.

 

i have tried adding it directly to the index.php and it works but i just cant mange to get it to work inside information.php

 

can anyone offer any help with this please? thanks!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...