noscript trap redirection thats 4.01 trans compliant

  • Thread starter Jonathan N. Little
  • Start date
J

Jonathan N. Little

I want to trap if a browser has JavaScript disabled and redirect to a
warning page for a page that requires scripting to be view. And the
'Catch' is to make it 4.01 transitional compliant

I tried:

<noscript><META http-equiv="refresh"
content="0;URL=/cgi-bin/error.cgi?e=nojs"></noscript>

in the head but this produces a nesting error the validator...any ideas

been googling away but have discovered anything useful yet...
 
S

SpaceGirl

Jonathan said:
I want to trap if a browser has JavaScript disabled and redirect to a
warning page for a page that requires scripting to be view. And the
'Catch' is to make it 4.01 transitional compliant

I tried:

<noscript><META http-equiv="refresh"
content="0;URL=/cgi-bin/error.cgi?e=nojs"></noscript>

in the head but this produces a nesting error the validator...any ideas

been googling away but have discovered anything useful yet...

better to do it server side. You can (to an extent) detect if a client
has JS from a server. Have it redirect instead.

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
S

Steve Pugh

Jonathan N. Little said:
I want to trap if a browser has JavaScript disabled and redirect to a
warning page for a page that requires scripting to be view. And the
'Catch' is to make it 4.01 transitional compliant

I tried:

<noscript><META http-equiv="refresh"
content="0;URL=/cgi-bin/error.cgi?e=nojs"></noscript>

in the head but this produces a nesting error the validator...any ideas

<noscript> isn't valid inside <head>.

So if you insist on having pages that only work with JS reverse the
process. Have a standard page at the primary URL and use a JS redirect
in that page to redirect to the JS page.

Steve
 
R

Richard

I want to trap if a browser has JavaScript disabled and redirect to a
warning page for a page that requires scripting to be view. And the
'Catch' is to make it 4.01 transitional compliant
<noscript><META http-equiv="refresh"
content="0;URL=/cgi-bin/error.cgi?e=nojs"></noscript>
in the head but this produces a nesting error the validator...any ideas
been googling away but have discovered anything useful yet...

You could try putting the <noscript> in the body which is where it belongs
anyways.
Why? How does the script know what to do before the page is loaded?

<body>
<noscript>
Your javascript is turned off.
<a href="whatever">Click here</a> for a suitable page.
</noscript>
</body>

I would much rather have the choice of going elsewhere then being redirected
automatically and instantly.
I may be wrong, but I think the refresh thing has to have a value greater
than "0".
 
J

Jonathan N. Little

Richard said:
You could try putting the <noscript> in the body which is where it belongs
anyways.
Why? How does the script know what to do before the page is loaded?

<body>
<noscript>
Your javascript is turned off.
<a href="whatever">Click here</a> for a suitable page.
</noscript>
</body>

I would much rather have the choice of going elsewhere then being redirected
automatically and instantly.
I may be wrong, but I think the refresh thing has to have a value greater
than "0".
Thank I'll have to rethink this.

Some of the page content is dynamically inserted with client side
script, it generates the site's navigation and other aspects. I want to
trap that and redirect to a page that explained this and way it was
important to the site. Didn't want to use SSI on all may pages, and for
some thing client side is very effect and efficient than doing it all
server side.


Maybe I will do as you suggest and have the noscript create a small
warning banner at the top of the page will a link to my more descriptive
error page for assistance, since this is the only error that the W3C
validator flags on my pages....

Oh, and you might be right about the refresh time value, should look it
up to refresh my memory!
 
J

Jonathan N. Little

Steve said:
<noscript> isn't valid inside <head>.

So if you insist on having pages that only work with JS reverse the
process. Have a standard page at the primary URL and use a JS redirect
in that page to redirect to the JS page.

Steve

too many pages involved to be practical, but thanks I missed the
validity to the tag's location. It is normally displaying regular markup
that must in the in body...

http://www.w3.org/TR/1999/REC-html401-19991224/interact/scripts.html#h-18.3.1
Scripts in HTML documents

I just haven't found this to be the easiest read :)
 
J

Jukka K. Korpela

Jonathan N. Little said:
I want to trap if a browser has JavaScript disabled and redirect to a
warning page for a page that requires scripting to be view.

How foolish. Do you like trapping search engines as well, or do you expect
them to "upgrade" to a browser of your liking?
And the
'Catch' is to make it 4.01 transitional compliant

Pointless. Like struggling for grammatical correctness in a sentence that
makes no sense.
been googling away but have discovered anything useful yet...

Could this give some clue:
http://www.google.com/search?q="this+page+requires"

If you used JavaScript for something useful, you would simply include
a <noscript> element that explains the situation, as prominently as you
like, hopefully telling what the user really gains if he turns JavaScript
on.
 
T

Toby Inkster

Jonathan said:
Didn't want to use SSI on all may pages, and for some thing client side
is very effect and efficient than doing it all server side.

"I didn't want to use SSI" has to be the dumbest reason for a Javascript
navigation system that I've ever heard.

"I don't have SSI available" or "I don't know how to use SSI" or "What the
hell is SSI?!" are all much better excuses.
 
J

Jonathan N. Little

Toby said:
Jonathan N. Little wrote:




"I didn't want to use SSI" has to be the dumbest reason for a Javascript
navigation system that I've ever heard.

"I don't have SSI available" or "I don't know how to use SSI" or "What the
hell is SSI?!" are all much better excuses.

1. I said javascript was import to function, not just the navigation of
my site.
2. Obviously your a 'structure vs style' guy
3. Client side can very efficient and effective tool where client
interaction is important to the site verses relying solely server side
especial for slow dialup visitors
4. Aesthetics and style can be an integral part of the purpose of a
website. Depends on the nature and function of your site. May not suit
yours, but I am an artist, and a just Sargent Friday's approach of "Just
the fact's Mame" neither serves my patrons, nor sells my art.

Disagree with me, that's fine, if you don't have anything constructive,
don't insult me.
 
O

Oli Filth

Jonathan said:
3. Client side can very efficient and effective tool where client
interaction is important to the site verses relying solely server side
especial for slow dialup visitors

Unless I'm missing something, I don't understand how a
Javascript-generated navigation system can be more "efficient" than
generating it server-side?

And why is it more "effective"? Quite the opposite, I would've thought,
seeing as anyone with Javascript disabled won't be able to use your
site, *and* search engines won't be able to index any of your pages.
4. Aesthetics and style can be an integral part of the purpose of a
website.

Surely basic functionality (i.e. a site that is guaranteed to work and
be usable) is the most important aspect of a web page? Aesthetics,
whilst very important, should come second to the emphasis on designing
your site so that the user can actually use it.
 
J

Jonathan N. Little

Oli said:
Unless I'm missing something, I don't understand how a
Javascript-generated navigation system can be more "efficient" than
generating it server-side?

If you have a form, client side validation of data can be much faster
than then validating solely server side and bouncing the page back for
correction and be resubmitted. If some form input offers different
options, javascript is much faster refilling option lists or field
recalulations then requiring the form be sumitted each step of the way,
are a couple of example I can think of at the moment.
And why is it more "effective"? Quite the opposite, I would've thought,
seeing as anyone with Javascript disabled won't be able to use your
site, *and* search engines won't be able to index any of your pages.

As to search engines, that is a valid point. Since SSI would allow the
bots to 'see' the page fully rendered and links therefore traversable,
then that would be advantageous. I would just have to convert the
managment of my links from the javascript db to CGI and just use
includes for the navbar insertion. If they have JS disabled they will
just loose some of the 'bell & whistles' (Thinking out loud)...

I don't mind being wrong, I did ask for advice not abuse....Thanks Oli

I'm going to ponder this some more....
Surely basic functionality (i.e. a site that is guaranteed to work and
be usable) is the most important aspect of a web page? Aesthetics,
whilst very important, should come second to the emphasis on designing
your site so that the user can actually use it.
 
T

Toby Inkster

Jonathan said:
If you have a form, client side validation of data can be much faster
than then validating solely server side and bouncing the page back for
correction and be resubmitted.

True. But you still have to validate on the server as well.
 
J

Jonathan N. Little

Toby said:
Jonathan N. Little wrote:




True. But you still have to validate on the server as well.

Absolutely! And I do, to do otherwise would be an invitation! View my
site and see what I am talking about. The JS makes the management a snap
to add, delete or reorganize the navbar. CSS mainly drive the function,
degrades to a list on none supporting browsers. Hovers for convenience,
and updates a 'you are here' link path in the banner. The site layout is
in a single reference db, no syncing errors.

http://www.littleworksstudio.com/

I will take suggestions. I just want to pull my site's navigational
layout from a single data source. I have to finish some pages priority
then I will focus on an alternate to JS for the navbar implementation.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top