0

I am currently developing a mobile app with Apache Cordova in Visual Studio.

I need to load an image from a server so I used this Code:

<img  src="http://ddragon.leagueoflegends.com/cdn/6.22.1/img/champion/Annie.png" alt="test"/>

Later on the source for the image will be created dynamic. I tested the code in a blank HTML Document and it worked but in my project it doesnt. Not even the alt text is displayed.

VS gave me the hint to replace the url with the equivalent base64 code and did it automatically and then it worked but this isnt really an option for me. Maybe you cant retrieve Images from URLs this way in Cordova?

This is the only reason I can imagine but I hope you maybe know some others.

Thank you for your help.

  • for the love... you use the `src` attribute to get the image, not the `id` attribute. If there is no `scr` attribute, nothing displays. – yaakov Nov 16 '16 at 18:26
  • Whops. That was some kind of a Copy and Paste error. It is src in my code!!! –  Nov 16 '16 at 18:42

2 Answers2

0

Make the id attribute into a src attribute. https://jsfiddle.net/8u2Ln605/

yaakov
  • 4,568
  • 4
  • 27
  • 51
  • Thank you but its already updated. It was src in my code. Just a Copy Paste Fail... –  Nov 16 '16 at 18:51
0

I found the answer! They changed the Secrurity System for Cordova: Issue with Android Hybid app to display remote image with Ionic framework?

So i solved it by changing the secrurity settings like in one of the answers you found in that link!!!

Community
  • 1
  • 1