Solved

image from variable

Posted on 1999-01-29
3
129 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
3 Comments
 
LVL 4

Expert Comment

by:martinag
Comment Utility
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
Comment Utility
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
Comment Utility
<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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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.
This article discusses how to create an extensible mechanism for linked drop downs.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now