myextn = ".png"; because I'd like to show images from the Internet, and images that are picked from the device with the activity starter.Might take a little bit of fiddling with the code here to get the syntax right.
And then make sure you recheck the blocks to ensure the list of images is just the filename without the extension [apple,bike,bed]
Am guessing the big white space is failed images? I only see a white webviewer before I click on the Home button to load the html page? There is nothing in the html to create the white space so it must be coming from the script?
Use imagemagick: mogrify -format png *.jpg
<!DOCTYPE html><html>
<head> <meta name="author" content="puravidaapps.com"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> <script src="jquery-1.8.3.min.js"></script> <title>ImageView</title>
<style>img { width:100px; margin:0px; padding:0px;}body { margin:0px; margin-top:0px; padding:10px;}</style> </head>
<body>
<p id="my-paragraph"></p>
<a href="javascript:;"><img src='dolphin.jpg' onClick=document.getElementById('my-paragraph').innerHTML='Hello!'></a>
</body>
</html>And for anyone who's wondering what I've tried: I have tried a different jQuery method of creating the image elements (var myElement = $("<img>")) and settings their attributes (myElement.attr("src", val)). I have also tried using HTML instead of jQuery, since I eventually want to get away from jQuery (that didn't work at all).
Thank you for all your help!
<!DOCTYPE html><html>
<head> <meta name="author" content="puravidaapps.com"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> <script src="jquery-1.8.3.min.js"></script> <title>ImageView</title>
<style>img { width:100px; margin:0px; padding:0px;}body { margin:0px; margin-top:0px; padding:10px;}
</style></head>
<body>
<p id="my-paragraph"></p>
<div><img id='image_id' src='dolphin.jpg'><img id='image_id' src='bear.jpg'><img id='image_id' src='tiger.jpg'></div><script>$('img').click(function(){ document.getElementById('my-paragraph').innerHTML=$(this).attr('src'); });</script>
</body>
</html>I probably did something really silly and can't see it. Do you my mistake?
Thanks again!
Edited
P.S. I tried adding ClearCache back in, and brought back the Web1 component. Nada.
<!DOCTYPE html><html>
<head> <meta name="author" content="puravidaapps.com"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> <script src="jquery-1.8.3.min.js"></script> <title>ImageView</title>
<style>img { width:75px; margin:0px; padding:0px;}body { margin:0px; margin-top:0px; padding:10px;}
</style></head>
<body>
<p id="mylabel"></p>
<div><img id='image_id' src='dolphin.jpg'><img id='image_id' src='bear.jpg'><img id='image_id' src='tiger.jpg'></div><script>$('img').click(function(){ document.getElementById('mylabel').innerHTML=$(this).attr('src'); window.AppInventor.getWebViewString(); window.AppInventor.setWebViewString($(this).attr('src')); });</script>
</body>
</html>