Recommended Driver Scanner

Member Panel



Join the PC Help Forum Team

Join PC Help Forum on Facebook

Join the PCHF Distributed Computing Teams

Try the NEW PC Help Forum Dark style

Link to PCHF from other parts of the Internet
PC Forum PC Help Forum » Web & Networking » Web Design » Javascript Image Issue

Web Design - Javascript Image Issue posted in the Web & Networking forums; Hi, How is possible to show an image without using document.write document.write('<img src="image.jpg" border="0">') Thanks for all the help provided...

JOIN US NOW to remove these Ads

Post New Thread  Reply
  #1  
Old 10-09-2008
New Poster
 
Join Date: Oct 2008
Posts: 2
PC Experience: Very Experienced
tribalmp - See this Members User comments on their Profile page
Arrow Javascript Image Issue

Hi,

How is possible to show an image without using document.write

document.write('<img src="image.jpg" border="0">')

Thanks for all the help provided


  #2  
Old 10-09-2008
Jelly Bean's Avatar
Moderation Team Leader
My PC
 
Join Date: Feb 2008
Location: Swansea
Posts: 7,818
PC Experience: I Try My Best.
Jelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile pageJelly Bean - See this Members User comments on their Profile page
Send a message via MSN to Jelly Bean Send a message via Yahoo to Jelly Bean Send a message via Skype™ to Jelly Bean
Default Re: Javascript Image Issue

Hello and welcome to PCHelpForum.

We have a great Tech Team who will help you with your issue do not worry.

I have marked your thread as "Open" in readyness for the team.

JB.


__________________
It is all in the hardware..........................................
Sources:
Microsoft Home Page /Seagate Home Page /Petri Home Page

PCHF Rules / Home Page / Prework /Windows Vista Home Page / XBOX360 / Test your Internet Speed
  #3  
Old 10-09-2008
New Poster
 
Join Date: Oct 2008
Posts: 2
PC Experience: Very Experienced
tribalmp - See this Members User comments on their Profile page
Default Re: Javascript Image Issue

Hi,

Here is the code in question.

<SCRIPT LANGUAGE="JavaScript">
function imageError() {
alert("This message will show if the image didnt load")
}
</script>

<img src="images/fail.jpg" border=0 onError="imageError(this)" onAbort="imageError(this)">

-----------------------------------------------
And i changed to this in hope to load a second image
-----------------------------------------------

<SCRIPT LANGUAGE="JavaScript">
function imageError() {
document.write('<img src="image/ok.jpg" border="0">')
}
</script>

<img src="images/fail.jpg" border=0 onError="imageError(this)" onAbort="imageError(this)">

But, the problem is that the image loads in a new layer, cleanning all the text, css, etc


  #4  
Old 10-13-2008
ladygreenwitch's Avatar
HR Director
My PC
 
Join Date: Jul 2005
Location: Bay Area California
Posts: 5,778
PC Experience: PC Illiterate
ladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile page
Default Re: Javascript Image Issue

Hey Tribal,

My welcome to PCHF as well.

I am going to PM one of our users who I know may have the information that you are looking for.

Please keep an eye out for their post.

TTFN

LGW


  #5  
Old 10-14-2008
Silver Member
My PC
 
Join Date: Sep 2006
Posts: 172
mintedjo - See this Members User comments on their Profile page
Default Re: Javascript Image Issue

Helloo!
I don't think document.write is any good for anything... :-P
At least I've never found a good use for it.

It looks like you want to add a picture to your page.

Code:
    var elementName = 'CHANGE_ME'; /* ID of the html element you want to add the pic to */
    var imageName = 'CHANGE_ME.BMP'; /* Name of the image file */
    var myImage = document.createElement('img');
    myImage.setAttribute('src', imageName);
    document.getElementById(elementName).appendChild(myImage);
You can find lots of good information about DOM manipulation online.
If this isn't what you want or you have any questions just ask.

Joe


__________________
teh 1337 j03
  #6  
Old 10-15-2008
ladygreenwitch's Avatar
HR Director
My PC
 
Join Date: Jul 2005
Location: Bay Area California
Posts: 5,778
PC Experience: PC Illiterate
ladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile pageladygreenwitch - See this Members User comments on their Profile page
Default Re: Javascript Image Issue

Hey Guys,

@ Mintedjo, How ya doin M8? Haven't seen you in a while. You weren't who I had in mind, but thanks for chiming in. Always nice to see you.

@ Tribal, let us know how or if that works for you, we'll keep an eye out for your post.

TTFN

LGW



Reply
Satellite TV on your PC - over 3000 Channels! Click Here!

Bookmarks

Tags
image, issue, javascript, open

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

All times are GMT +1. The time now is 12:16 AM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC7
All Graphics & Content Copyright © 2004-2008 - PC Help Forum.com


Back to Top