Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro JSP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 10th, 2004, 07:23 PM
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default Alternate pictures / video

Hi,

I am absolutely useless at Java but I recon this is the language needed.

alright.. where to start without getting confusing...

I store HTML documents in MySQL.. all fine.
Some of those HTML documents contain code to insert pictures or video like this one:
<img border="0" dynsrc="test2.wmv" start="mouseover" loop="0" width="208" height="98"></p>
or
<img border="0" src="Pictures/test.jpg" width="100" height="144" align="left">

What I need is a code which will automatically change the picture or video name to a 'default' picture or video, incase the original is missing.

If this isn't possible, I can write (with time!) a small program in PHP which will look for the string .gif" and will replace it with .gif" alt="nopicture.gif" but I will really prefer a clean way for doing this.. if its possible.

Thanks.
Reply With Quote
  #2 (permalink)  
Old December 11th, 2004, 07:44 PM
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just done some test and in my surprise.. there is no way to display an alternate picture in HTML if the original is missing...
Reply With Quote
  #3 (permalink)  
Old December 11th, 2004, 09:13 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 1 Time in 1 Post
Default

I believe your conclusion is incorrect.

Try this:

<img src='your_original_pic.jpg' onerror='this.src="your_replacement_pic.jpg"' alt='test'/>

-Snib - http://www.snibworks.com
Where will you be in 100 years?
Reply With Quote
  #4 (permalink)  
Old December 12th, 2004, 07:09 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm glad to be wrong :)

I'm using the notepad and MS frontpage.. just so you know, if you enter your line in MS Frontpage, the preview generate an error message..(works fine from the host server) so I would have been looking forever without your help!

Thks.
Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 10 - Alternate order walabok BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 March 19th, 2008 12:04 PM
play online video or video rajanikrishna ASP.NET 2.0 Basics 1 September 17th, 2007 01:01 PM
Video buffering, streaming, and displaying video t CurvyBabe C# 1 March 9th, 2007 12:17 PM
alternate method of using MapQuest tennisdad1 Javascript How-To 2 January 23rd, 2006 07:06 PM
alternate ordering polecat XSLT 17 October 2nd, 2003 08:35 AM



All times are GMT -4. The time now is 12:44 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.