[FX.php List] FMSkipRecords
Kevin Futter
kfutter at sbc.melb.catholic.edu.au
Tue Mar 28 14:54:18 MST 2006
On 29/3/06 3:31 AM, "DC" <dan.cynosure at dbmscan.com> wrote:
> This design has the benefit of actually falling back to a clickable link
> if JS is not available - so it degrades gracefully.
But your link doesn't go anywhere, which is my point. It's a dummy used to
trigger some JavaScript. If JS is off, it won't degrade gracefully at all,
just fail. Completely. Here's a nice synopsis that talks about some of these
issues:
http://www.wait-till-i.com/index.php?p=104
>
> Kevin, the onsubmit button approach gives you a button - not a text
> link. So, if you are looking for a page full of grey buttons then use
> the standard form element button. But, if you want actual text links to
> submit forms and carry POST data along you have to do this little
> javascript dance. And yes, javascript is required - so if you want your
> script to degrade gracefully, you'd better have some kind of fallback
> like an a href tag.
Your point is taken about the onsubmit buttons, but you I can't see anywhere
in the code supplied so far in this thread (which is now wildly off-topic!)
that gives a valid URI in a href as a graceful fallback. For example:
<a href="javascript:void(0)"
ONCLICK="document.sub.submit(); return false;"
target="_blank">LINK TEXT HERE</a>
>
> Finally, if you want to be completely standards compliant (and not just
> hack a few form-submitting links together for a one-off) you probably
> want to check out the 'behaviour.js' library to get 'clunky' javascript
> out of HTML altogether.
>
> http://bennolan.com/behaviour/
This is called 'unobtrusive JavaScript', and of course is far and away the
neatest, cleanest and most extensible approach to this sort of thing.
Ideally you'd have something like this:
<a href="fallback.php" class="submitForm">Link Text</a>
And then use Unobtrusive JS to trigger an onclick based on the class name of
the link. With no JS available you'll get a fallback page. All the JS logic
is in an external file, leaving only clean, semantic markup.
>
> thanks for the lively discussion - i feel quite edified.
> dan
My pleasure! I suppose we should get back on topic now ...
--
Kevin Futter
Webmaster, St. Bernard's College
http://www.sbc.melb.catholic.edu.au/
More information about the FX.php_List
mailing list