简体   繁体   中英

Image replacing using jquery

I have used GD library function to color my images using coordinates marked with the help of jquery editor. the problem i am facing is all these coloring in done using ajax on the same image which needs to displayed on the page. And i have replaced the image of that particular div using jquery.

$('.Plot_left img').attr("src" , "<?php echo $mapimage_path .'?timestamp='.strtotime(date('y-m-d h:m:d'));?>");

Even though i have appended timestamp in the image src iam not able to see the output at the first load. I need to refresh multiple times to see the desired output.

Is there any other solution for this.

Double quotes(") wont escape single quotes (') but vice versa is possible, so try this way

$('.Plot_left img').attr("src" , '<?php echo $mapimage_path ."?timestamp=".strtotime(date("ymd h:m:d"));?>');

Happy Coding :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM