Jump to content

PHP inside JavaScript


kurt.santo

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

Archived

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

×
×
  • Create New...