Graceful default to plain HTML in a simple page of photos?

C

Charles Packer

I put up a simple page of thumbnails
linked to photos that come up in a
separate window at
http://cpacker.org/trainwreck
and my audience reamed me out for not
accommodating browsers with Javascript
turned off. Could somebody point me
to a tutorial or FAQ list that shows how
to default to standard HTML in a simple
case like this?
 
R

rf

Charles Packer said:
I put up a simple page of thumbnails
linked to photos that come up in a
separate window at

Why? Perhaps I don't want a "seperate" window. Why exactly do *you* think I
need one?
http://cpacker.org/trainwreck
and my audience reamed me out for not
accommodating browsers with Javascript
turned off.

Rightly so, as your thumbnails do absolutely nothing without javascript. No
gracefull degradation at all.

Javascript should *add* to a site, not be *required* for the sites
operation.
Could somebody point me
to a tutorial or FAQ list that shows how
to default to standard HTML in a simple
case like this?

Simply open the images in the same window. That would mean using a simple
anchor element (<a ...>) and getting rid of all the javascript.
 
R

RobG

I put up a simple page of thumbnails
linked to photos that come up in a
separate window at
http://cpacker.org/trainwreck
and my audience reamed me out for not
accommodating browsers with Javascript
turned off. Could somebody point me
to a tutorial or FAQ list that shows how
to default to standard HTML in a simple
case like this?

The cheap and simple simple solution is wherever you have something
like:

<a href="javascript:ShowSecondary('a3.jpg','width=640,height=480')">

change it to:

<a href="a3.jpg" onclick="
ShowSecondary('a3.jpg','width=640,height=480');
return false;
">

If scripting is disable or not available, the link will be followed.
If scripting is available, the onclick handler does its thing and
return false stops the browser following the link.

That is a very basic fix, there are much better approaches but it will
do the job for now.
 
C

Charles Packer

The cheap and simple simple solution is wherever you have something
like:
<a href="javascript:ShowSecondary('a3.jpg','width=640,height=480')">

change it to:

<a href="a3.jpg" onclick="
ShowSecondary('a3.jpg','width=640,height=480');
return false;
">

If scripting is disable or not available, the link will be followed.
If scripting is available, the onclick handler does its thing and
return false stops the browser following the link.

Thanks, but this doesn't do what I want. It does the right thing when
Javascript is disabled, but it does that AND puts
up the separate window when Javascript is enabled.
When Javascript is enabled, I want to keep the thumbnail
page in the browser window while the clicked-on image
is shown in the full-size version in its own window.
 
G

Gregor Kofler

Charles Packer meinte:
Thanks, but this doesn't do what I want. It does the right thing when
Javascript is disabled, but it does that AND puts
up the separate window when Javascript is enabled.

Not when you've added "return false;".

Gregor
 
C

Charles Packer

Thanks, but this doesn't do what I want. It does the right thing when

Oops! Disregard! I hadn't moved the double-quote to follow
the 'return false;' Works as desired now. Thanks again.
 
T

Thomas 'PointedEars' Lahn

RobG said:
The cheap and simple simple solution is wherever you have something
like:

<a href="javascript:ShowSecondary('a3.jpg','width=640,height=480')">

change it to:

<a href="a3.jpg" onclick="
ShowSecondary('a3.jpg','width=640,height=480');
return false;
">

And without the need for double maintenance:

<a href="a3.jpg"
onclick="showSecondary(this.href, 'width=640,height=480');
return false;">

However, forcing the window size this big can introduce problems with
smaller desktops. I would also write

onclick="return !showSecondary(this.href, 'width=640,height=480');"

and let showSecondary() return `false' (or a false-value) in case the window
could not be created.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top