Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

image from variable

Posted on 1999-01-29
3
Medium Priority
?
135 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 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

596 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