ios - Unable to use images from document directory in JavaScript file -


i storing user specific images getting server in document directory. want display images on bing map @ pins(inside pin infobox). loading images dynamically using javascript. images not displaying on map.

i setting images html content of infobox like,

pininfobox.sethtmlcontent('<div class="arrow_box"><div class="content" id="content"><img id="localfile" src="file:///var/mobile/containers/data/application/395e5eed-2fb4-4505-861e-2da9ab96433b/documents/my_image.jpg/"/>'+pin.title+'</div></div>'); 

if use remote file , access via http protocol work,

pininfobox.sethtmlcontent('<div class="arrow_box"><div class="content" id="content"><img id="localfile" src="http://a.abcd.com/static/images/zoom/magnifying-glass.png" />'+pin.title+'</div></div>'); 

i don't know why not taking image saved in document directory.

please me resolve this.

i solved based on @tiblu's comment.

javascript file , images should in same path. 

but can't write images bundle these images downloaded server @ runtime. copied javascript file documentdirectory during application launch work images. can access image directly it's name , no need of specifying full path.

pininfobox.sethtmlcontent('<div class="arrow_box"><div class="content" id="content"><img id="localfile" src="my_image.jpg"/>'+pin.title+'</div></div>'); 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -