By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?

--
Charles Packer
http://cpacker.org/whatnews
mailboxATcpacker.org

Nov 14 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
rf

"Charles Packer" <ma*****@cpacker.orgwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
>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.

--
Richard.
Nov 14 '07 #2

P: n/a
On Nov 14, 9:56 pm, Charles Packer <mail...@cpacker.orgwrote:
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.
--
Rob

Nov 14 '07 #3

P: n/a
On Nov 14, 7:26 am, RobG <rg...@iinet.net.auwrote:
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.

--
Charles Packer
http://cpacker.org/whatnews
mailboxATcpacker.org
Nov 14 '07 #4

P: n/a
Charles Packer meinte:
On Nov 14, 7:26 am, RobG <rg...@iinet.net.auwrote:
><a href="a3.jpg" onclick="
ShowSecondary('a3.jpg','width=640,height=480');
return false;
">
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
--
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Nov 14 '07 #5

P: n/a
On Nov 14, 9:03 am, Charles Packer <mail...@cpacker.orgwrote:
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.

--
Charles Packer
http://cpacker.org/whatnews
mailboxATcpacker.org

Nov 14 '07 #6

P: n/a
RobG wrote:
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
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Nov 14 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.