Jump to content

PHP inside JavaScript


kurt.santo
 Share

Recommended Posts

Can you apply php inside JavaScript? For example could you reference an image to preload as "furniture-3c-<?php echo $_GET['id']; ?>.jpg"? I would like to preload all nine images needed for each product in my product template (3 thumbs, 3 main images and 3 images for enlargement, which opens in pop-up).Kurt

Link to comment
Share on other sites

PHP runs before anything else. You can have PHP write out HTML code, or Javascript, or CSS, or XML, or PDF, or create an image, or whatever you want to do. As long as the web browser sees valid content when PHP is finished it doesn't matter what you use PHP for.

Link to comment
Share on other sites

PHP runs before anything else. You can have PHP write out HTML code, or Javascript, or CSS, or XML, or PDF, or create an image, or whatever you want to do. As long as the web browser sees valid content when PHP is finished it doesn't matter what you use PHP for.
As well with image pre-loading scripts? Thought they came kind of before anything else comes...Kurt
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...