I am trying to attach an image using jQuery but have gotten a strange problem.
(please ignore the ‘+num+’ as this is part of a loop)
var image = jQuery("#Slide_image"+num).val();
jQuery('img[name="image_'+num+'_data"]').attr("src","http://www.prelovac.com/vladimir/wp-content/uploads/2008/03/example.jpg");
The above works fine, the below does not:
var image = jQuery("#Slide_image"+num).val();
jQuery('img[name="image_'+num+'_data"]').attr("src",image);
HTML
<tr>
<td>Image:</td>
<td>
<input type="text" size="36" name="SlideShow_0_image" value="" />
<input id="upload_image_button" type="button" value="Upload Image" />
<img style="float:right;" name='image_0_data' src='' width='70' height='70' />
<br />Enter an URL or upload an image for the banner.
</td>
</tr>
Even though the image variable holds the same text
can anyone explain why?
Thanks
Eli
Im not 100% sure what the the problem was but it is now fixed, it might have had something do do with the cache.
Thanks for your help.