[TIMOB-330] android: dynamically update local urls fail with "absolute" paths
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2012-05-09T10:08:04.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Daniel Sternbergh |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:27:22.000+0000 |
Updated | 2017-03-10T18:21:37.000+0000 |
Description
A reference to a local file, for example <img
src="/images/pic0.png">
will correctly load the file
pic0.png from the .../Releases/images directory if set in the HTML
at first page load, but if the location is changed dynamically in
JS, the file will not be found and will fail to load. A relative
path (<img src="images/pic0.png"
) will succeed if
the images directory is in the same parent directory as the HTML
page referencing it.
Comments
- dukz 2011-04-15
Any timeline on this?
Was looking for the problem and found out 2 hours later. :(
- Dawson Toth 2012-05-09
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); /* These images can be downloaded from: - http://appc.me/content/bug.png - http://appc.me/content/kitten.jpg */ var images = [ '/images/bug.png', 'images/kitten.jpg' ]; var imageIndex = 0; var image = Ti.UI.createImageView({ image: images[0], bottom: 50 }); win.add(image); var changeImage = Ti.UI.createButton({ title: 'Change Image', bottom: 0, height: 50 }); changeImage.addEventListener('click', function (evt) { image.image = images[++imageIndex % images.length]; }); win.add(changeImage); win.open();
- Lee Morris 2017-03-10 Closing ticket as the issue cannot be reproduced.