jsp - How do i change image src using jquery? -


i want change image src jsp page through jquery. code right below

$('#image').attr("src","file:///d:/vow/themes/multiflex/webapp/multiflex/images/chart.png"); 

in jsp file have

<table> <tr style="padding-bottom:5px;"> <td>&nbsp;&nbsp;image &nbsp;&nbsp;</td> <td>&nbsp;<img id="image"/></td> <td>&nbsp;</td> </tr> </table> 

but see no display on jsp page after run.i have source code , image in different directories.

i think because d seen d drive on client pc, wont let you. , if this, big security hole.

see below link

src absolute path problem

try relative path like

$("#image").attr("src", "/images/chart.png"); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -