Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Javascript in Product Description


biohazardbill

Recommended Posts

I searched but found nothing on this...

 

In adding a new product i have used HTML to create the product description instead of just text... this works fine, however now to add more functionality to the product desciption I am wanting to add javascript to it. When I click preview the preview main section is all white and you cannot scroll down nor is there a back button or anything. The javascript itself works for I have tested it in a standard html page.

 

Anyone know a way to get javascript to work in the product description?

Link to comment
Share on other sites

I searched but found nothing on this...

 

In adding a new product i have used HTML to create the product description instead of just text... this works fine, however now to add more functionality to the product desciption I am wanting to add javascript to it.  When I click preview the preview main section is all white and you cannot scroll down nor is there a back button or anything.  The javascript itself works for I have tested it in a standard html page.

 

Anyone know a way to get javascript to work in the product description?

Hi

What I do I put everything into a table, like pictures so I can display a picture in the size and resolution I want. I make the table width not more then 300 pix.

Should work with script too, bur haven't tried it yet.

Werner

Link to comment
Share on other sites

Add your javascript functions in the <head> section of product_info.php.

 

Then in the product description use standard HTML to call the function.

 

<a href="java script:myjavscript()">Click to run myjavascript</a>

 

HTH

Tom

 

 

That is what I figured I would have to do... however the javascript changes per product which is why I was wanting it in the description... guess I will have to look into setting up variables however I am not sure how to do this in this scenario either...

Link to comment
Share on other sites

It's just PHP coding to dynamically create the variables you'll pass to the function.

 

Easy for me to say. :-)

 

Take a look at the code already in the product_info.php for generating the popupwindow variables that are passed to the javascript.

 

HTH

Tom

Link to comment
Share on other sites

Well I thought it worked... it works in the preview portion of the admin section however it doesnt work in the regular webpage.

 

For testing purposes I used the popupWindow javascript that oscommerce uses on its product_info page and renamed the function so that is does not conflict with the existing function...

 

Now in the regualr site it creates the pop up window and then sets the originating product info page back to the default index page.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...