kurt.santo Posted October 16, 2007 Share Posted October 16, 2007 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 More sharing options...
justsomeguy Posted October 16, 2007 Share Posted October 16, 2007 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 More sharing options...
kurt.santo Posted October 17, 2007 Author Share Posted October 17, 2007 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 More sharing options...
justsomeguy Posted October 17, 2007 Share Posted October 17, 2007 PHP gets executed on the server before the web browser sees anything, including Javascript, regardless of what it does. Link to comment Share on other sites More sharing options...
kurt.santo Posted October 17, 2007 Author Share Posted October 17, 2007 PHP gets executed on the server before the web browser sees anything, including Javascript, regardless of what it does.Thanks for the clarification:-)Kurt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.