Hi All,
I'm trying to construct a simple Javascript line (used in a swap image) using PHP. Here it is:
So this, I'd hoped, would fill in the value of the image to be swapped with from a DB call earlier on.PHP Code:<a href="javascript:;" onclick="MM_swapImage('bigimage','','<?php $this->absolute_path . 'images/large/' . $vehicle['int_main'];?>',1)">
The contructed line looks like this:
It should look like this:PHP Code:<a href="javascript;:" onclick="MM_swapImage('bigimage','','',1)">
I know $this->absolute_path . 'images/large/' . $vehicle['int_main'] produces the right code (an image name) and the JS swap image works but simply inserts a blank because there's no image to swap with i.e. it is missing in the JS line? I'm all out of ideas now, anyone offer some insight?PHP Code:<a href="javascript;:" onclick="MM_swapImage('bigimage','','images/large/dsc_3647.jpg',1)">
Many thanks
Rob







Bookmarks