Solved

Actually VBScript - images do not display

Posted on 2002-07-18
8
247 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
[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
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server Timeout with Loop 6 59
Change visitor's REMOTE_ADDR to server's REMOTE_ADDR 2 46
VBScript on Html 15 57
IIS components 2 34
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

733 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