Solved

Actually VBScript - images do not display

Posted on 2002-07-18
8
245 Views
Last Modified: 2010-08-05
Ok, I have an issue.

I want to add rows to a table and in each row is an image (a very small one).  now when i add the rows and the image tags everything is fine except the image does not appear.

I am sure it is because i am adding the image to the page from the client,but WHY? how do i fix that?

Thanks,
Chris

P.S. I can NOT refresh the page.
0
Comment
Question by:turbosig
8 Comments
 
LVL 20

Expert Comment

by:jitganguly
ID: 7162535
The img tag needs a src location that tells you where the image file is stored.
When you do it in Client side ( you said can not refresh page), it has to be stored somwhere with the same place wher you specify src in img tag.
Check that , and it should work
0
 
LVL 2

Author Comment

by:turbosig
ID: 7162700
I am not sure I understand. the src="line.gif".  It is in the same folder (location) as the page.
0
 
LVL 3

Expert Comment

by:tejaspurani
ID: 7162781
just for knowledge can u show me the code
how u reference the cliend side image from server page?

T.P.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 20

Expert Comment

by:jitganguly
ID: 7162828
TP,
May be he is just doign everything on Clientside.

turbosiq,
When you add a new row are you referrign to the same loction ? Does the gif/jpeg file exists ?
0
 
LVL 30

Expert Comment

by:third
ID: 7163662
i agree with TP, could you show some code please?
0
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 50 total points
ID: 7169334
Here is an example on adding rows to a table. When using innerText, it's not parsed as HTML, so the html code in the second cell will appear as text. When using innerHTML, the html code is parsed, so in the third cell, it will appear as an image.

Note: This is IE only. It should work in N6 with some adjustments, though.

<html>
<head>
<script>
function addRow()
{
     var tbl=document.all.MyTable;
     var row=tbl.insertRow();
     var cell=row.insertCell();
     cell.innerText='Image:';
     cell=row.insertCell();
     cell.innerText='<img src="MyImage.gif">';
     cell=row.insertCell();
     cell.innerHTML='<img src="MyImage.gif">';
}
</script>
</head>
<body>
<table id="MyTable" border="1">
     <tr>
          <td>Type</td>
          <td>Code</td>
          <td>Image</td>
     </tr>
</table>
<input type="button" value="add" onClick="addRow();">
</body>
</html>
0
 
LVL 58

Expert Comment

by:Gary
ID: 8845504
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept Answer by GreenGhost
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Migrated SQL connection issues 2012 6 39
Smart quotes being changed on insert 9 50
two-way Authentication ASP 3 80
replace quotes with UTF-8 character 38 86
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

862 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

23 Experts available now in Live!

Get 1:1 Help Now