Solved

image from variable

Posted on 1999-01-29
3
133 Views
Last Modified: 2010-04-09
say I have an object that has a property picturepath
so I like to use this property to get my picture.
I tried like this
<OBJECT ID="mypictureobject" CLASSID="CLSID:9AA7F4F0-629F-11D2-8CEB-00A0C949D865"></OBJECT>
<br>
<IMG SRC= 'mypictureobject.picturepath'>

but !!!! this does not work, all
mypictureobject.picturepath is a path to xxx.gif, and
I verified it is correct.
please if you are not sure about your answer
put is as comment.
thanks
0
Comment
Question by:hasmet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1845836
That will just set SRC to "mypictureobject.picturepath".
If you want to set it to the actual value of the variable, use this simple JavaScript:

<SCRIPT LANGUAGE="JavaScript">
<!--
document.write('<IMG SRC="' + mypictureobject.picturepath + '">');
// -->
</SCRIPT>

Martin
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 100 total points
ID: 1845837
You have to do somthing like this:

<BODY onLoad="MyImage.src=mypictureobject.picturepath")>
<OBJECT ID="mypictureobject" CLASSID="CLSID:9AA7F4F0-629F-11D2-8CEB-00A0C949D865"></OBJECT>
<br>
<IMG SRC="dummy.gif" NAME="MyImage">

0
 
LVL 1

Author Comment

by:hasmet
ID: 1845838
<OBJECT ID="mypictureobject" CLASSID="CLSID:9AA7F4F0-629F-11D2-8CEB-00A0C949D865"></OBJECT>
<br>
<IMG ID = myimage>
<script>
myimage.src = mypictureobject.picturepath;
</script>

above works fine
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question