Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Simple Javascript popup problem


dezil

Recommended Posts

Basically ive added an extra pop up bit of javascript to the header to pop up some information and help files. I want to invoke these popups from the main page and information box.

 

From the main page i call

 

<a href="javascript:globalPopupWindow('help/products/index.htm#features')">

 

and as thats a html description it works fine the problem is when i try and call it from within php code. as below...

 

 

 

'<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' .
          '<a href="javascript:globalPopupWindow( 'help/products/index.htm#features )"> Help </a><br>');

 

This is from within the php code of the infobox and because it uses ' all around as soon as i put them in for javascript it thinks im defining php code not text. If i use no quotations the javascript wont work and if i use " it loads fine but the link is to java script:globalPopupWindow( as it closes the href tag.

 

For some reason i cant think of a way around this simple looking problem, so if someone could jsut give me a hand id really appreciate it!

 

Thanks

Link to comment
Share on other sites

Try;

 

<?php echo '<a href="javascript:globalPopupWindow( 'help/products/index.htm#features )"> Help </a><br>'); ?>

 

Or;

 

<?php echo '<a href="javascript:popupWindow(\'' . tep_href_link('help/products/index.htm#features') . '\')">' . Help . '</a>'; ?>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...