Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

ImageView fails to load with pre-escaped URLs (TI Mobile 1.4)

It appears that using properly escaped URLs fails? For instance, this works: (notice the spaces in the URL!)

var coverArt = Titanium.UI.createImageView({
    width:'300px',
    height:'300px',
    top:'5px',
    defaultImage:'logo.png',
    image:'http://codefromjames.com/radio/library/Motion City Soundtrack/Commit this to Memory/folder.jpg'
});
Titanium.API.info(coverArt.image);
mainWindow.add(coverArt);

However, this does not seem to work.

var coverArt = Titanium.UI.createImageView({
    width:'300px',
    height:'300px',
    top:'5px',
    defaultImage:'logo.png',
    image:'http://codefromjames.com/radio/library/Motion%20City%20Soundtrack/Commit%20this%20to%20Memory/folder.jpg'
});
Titanium.API.info(coverArt.image);
mainWindow.add(coverArt);
— asked December 1st 2010 by James O'Cull
  • imageview
  • iphone
0 Comments

1 Answer

  • Accepted Answer

    James

    You would need to unescape it to use it, ie:

    image:unescape('http://codefromjames.com/radio/library/Motion%20City%20Soundtrack/Commit%20this%20to%20Memory/folder.jpg')
    
    — answered December 1st 2010 by Paul Dowsett
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.