biohazardbill Posted February 14, 2005 Share Posted February 14, 2005 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 More sharing options...
whundt Posted February 14, 2005 Share Posted February 14, 2005 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? <{POST_SNAPBACK}> 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 More sharing options...
OceanRanch Posted February 14, 2005 Share Posted February 14, 2005 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 Link to comment Share on other sites More sharing options...
biohazardbill Posted February 14, 2005 Author Share Posted February 14, 2005 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 <{POST_SNAPBACK}> 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 More sharing options...
biohazardbill Posted February 14, 2005 Author Share Posted February 14, 2005 In testing a theory I put the javascript in the body of a standard html page... it still works there too so now I really do not understand why it wouldn't work in the product description. Link to comment Share on other sites More sharing options...
OceanRanch Posted February 14, 2005 Share Posted February 14, 2005 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 More sharing options...
OceanRanch Posted February 14, 2005 Share Posted February 14, 2005 This link might help a bit on adding php to the product description area. http://www.oscommerce.com/forums/index.php?showtopic=70099&hl= Tom Link to comment Share on other sites More sharing options...
biohazardbill Posted February 14, 2005 Author Share Posted February 14, 2005 Well I got it to work... without variables... I found the javascript they use for the enlarge image and it ends like this: //--></script> Instead of the typical: </script> I changed my existing code to reflect that and it works... :) Link to comment Share on other sites More sharing options...
biohazardbill Posted February 14, 2005 Author Share Posted February 14, 2005 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.