Re: History Replacement And New Location Combined
- From: David Mark <dmark.cinsoft@xxxxxxxxx>
- Date: Thu, 12 Jul 2007 14:51:27 -0700
On Jul 12, 3:23 pm, Randy Webb <HikksNotAtH...@xxxxxxx> wrote:
David Mark said the following on 7/12/2007 6:28 AM:
On Jul 11, 11:22 pm, Randy Webb <HikksNotAtH...@xxxxxxx> wrote:
David Mark said the following on 7/11/2007 7:55 PM:
"Randy Webb" <HikksNotAtH...@xxxxxxx> wrote in messageNo, you put the non-JS warning on the page and then you replace it using
news:YuednTlhAsRh9gjbRVn_vgA@xxxxxxxxxxxxxx
David Mark said the following on 7/11/2007 7:32 PM:I went over that with him. His is a JS-only app. So he will need to
> In each and every page, I have up to four 'submit' buttons with their<form method="get" action="someFileSoThatNonJSPeopleGoSomewhere.php"
respective onClick event handlers. If I used onSubmit event handler,Okay, but instead of:
it would have to decide what event needs to be serviced, actually
getting me back (through one additional step) to the same logic I've
already applied.
<form method="get" action="javascript: savePage();"
onSubmit="checkForm();">
Why not something like:
<form method="get" onsubmit="if (checkForm()) savePage(); return false">
onsubmit="return someFunction()">
function someFunction(){
if(checkForm()){
savePage();
return false;
}
return true;
}
generate the form with JS and present a NOSCRIPT warning to everyone else.
JS. If you put it in a noscript element and the script has an error,
then the JS crowd gets nothing.
I don't agree with that.
You are entitled to that opinion just as I am entitled to mine :)
In an HTML document, I say just document.write the form and pair
it with a NOSCRIPT tag.
It is far more reliable to make the noscript block part of the page and
then replace it with a form element using script.
In an XHTML document that is actually served as XHTML, I would insert the nodes
that make up the form after the page loads. Under what circumstances
would such a script error?
Hmm. Ever seen a site that uses third party scripts? Think about Google
AdSense and many others that you have no control over. If you have one
in your page and there is an error in that script, then yours is now
broken and your visitor won't see anything at all.
That makes sense. I hadn't considered that as I didn't think the OP
was writing an app that would have third-party scripts. In that case,
the visitor would see an error message (at least in IE.)
If you do it the other way, you must either wait for the page to load
to replace the warning message or simulate the DOMContentLoaded for
browsers that don't support it (ie put the script near the bottom of
the page, possibly with a timeout and hope for the best.) If you go
with the former method, you get a flash of the warning message, the
latter is a lot of trouble and not foolproof (as few things are with
IE.)
I have never seen a flash of the warning message but I have never put
anything other than a short message and no images on the page.
That works if there are no unscripted attractions on the page. I was
just thinking about the form. I figured that even though the form
wouldn't do anything without script, the page would load a
presentation of some sort. If not and if third-party scripts are
involved, then I agree with you.
Then it
loads almost instantly then I place images/forms and other things. But,
on a slow computer with a graphics heavy page it could be a problem.
Right. I would be most wary of Opera as I see content flash without
style all the time with that thing. IE does fine if you schedule your
DOMContentLoaded routine just before the closing body tag. Watch out
if you are inserting nodes into the body though. I have never
encountered the infamous "operation aborted" error and perhaps IE6's
hotfixes have addressed the problem at this point, but that has got to
be the worst catastrophe possible for a Web page.
.
- Follow-Ups:
- Re: History Replacement And New Location Combined
- From: Randy Webb
- Re: History Replacement And New Location Combined
- References:
- History Replacement And New Location Combined
- From: abc
- Re: History Replacement And New Location Combined
- From: David Mark
- Re: History Replacement And New Location Combined
- From: abc
- Re: History Replacement And New Location Combined
- From: David Mark
- Re: History Replacement And New Location Combined
- From: abc
- Re: History Replacement And New Location Combined
- From: David Mark
- Re: History Replacement And New Location Combined
- From: Randy Webb
- Re: History Replacement And New Location Combined
- From: David Mark
- Re: History Replacement And New Location Combined
- From: Randy Webb
- Re: History Replacement And New Location Combined
- From: David Mark
- Re: History Replacement And New Location Combined
- From: Randy Webb
- History Replacement And New Location Combined
- Prev by Date: Re: Disable a textbox by reference
- Next by Date: Re: Determine user Selection
- Previous by thread: Re: History Replacement And New Location Combined
- Next by thread: Re: History Replacement And New Location Combined
- Index(es):