Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to embed Javascript in PHP


Guest

Recommended Posts

How do I embed the following code into my osCommerce PHP pages?

 

<a onmousedown="return gt__md();" onmouseover="this.style.cursor='hand'; window.status='Click for company profile';" style="CURSOR: hand" tabIndex="-1" onmouseout="window.status='';" href="java script:gt__sp()"><img oncontextmenu="return false;" alt="Click for company profile" src="http://smarticon.geotrust.com/smarticon?ref=www.mtcompanystore.com" border="0" name="fekxeiyh" style="float: right">

Link to comment
Share on other sites

How do I embed the following code into my osCommerce PHP pages?

 

<a onmousedown="return gt__md();" onmouseover="this.style.cursor='hand'; window.status='Click for company profile';" style="CURSOR: hand" tabIndex="-1" onmouseout="window.status='';" href="java script:gt__sp()"><img oncontextmenu="return false;" alt="Click for company profile" src="http://smarticon.geotrust.com/smarticon?ref=www.mtcompanystore.com" border="0" name="fekxeiyh" style="float: right">

 

HI,

 

You could make a function:

 

function addMyJsCode() {
 $result.= '<script type="text/javascript">

  ... your JS code here ...

 </script>';

 return $result;
}

Then wherever you want to add the JS you call:

 

echo addMyJsCode();

 

Hope this helps.

Adam.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...