Solved

Actually VBScript - images do not display

Posted on 2002-07-18
8
246 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

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…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

777 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