HTML and the <img> tag

new BookmarkLockedFalling
cmccown
New Member
*

cmccown Avatar

Posts: 7Male

Post by cmccown on Jan 12, 2009 0:28:21 GMT -5

Hey all.

Having trouble with the <img> tag in an HTML statement...

The following works--the image is displayed::
html "<img src='http://runbasic.wikispaces.com/space/showimage/FrogGIF.gif'>"

The following does not work--the image is not displayed:

base$ = ProjectsRoot$ + "\test_project\"
html "<img src='";base$;"FrogGIF.gif'>"

I have copied the frog gif to the test_project directory.

Any thoughts?

Thanks

Last Edit: Jan 12, 2009 0:29:15 GMT -5 by cmccown
StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

Last Edit: Jan 12, 2009 2:11:57 GMT -5 by StefanPendl
[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
cmccown
New Member
*

cmccown Avatar

Posts: 7Male

Psycho
Full Member
***

Psycho Avatar

Posts: 196

cmccown
New Member
*

cmccown Avatar

Posts: 7Male

Psycho
Full Member
***

Psycho Avatar

Posts: 196

Post by Psycho on Jan 12, 2009 23:29:50 GMT -5

I've gotten into the habit of using double quotes, but you don't have to for this. The following should work just as well:

html "<img src='/FrogGIF.gif'>"



Psycho

EDIT: It will also work without the quotes, just like a normal html statement. Stefan's example should have worked but it was missing the first single quote after =

works:
html "<img src=/FrogGIF.gif>"
Last Edit: Jan 13, 2009 7:23:56 GMT -5 by Psycho