It "does the trick" because that function returns `undefined'.
void(something()) would also have "worked".
*Please* read the FAQ before posting:
http://jibbering.com/faq/#FAQ2_3http://jibbering.com/faq/#FAQ4_24
It is not that hard to miss, especially as the FAQ Poster script will post
each single FAQ here frequently.
PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <
http://www.vortex-webdesign.com/help/hidesource.htm>- Hide quoted text -
- Show quoted text -
Yes that would stop the postback but doesn't do the trick in this
situation. I posted the solution, which is completley javascript
related and not in the FAQ though it could be.
The real breakdown here is that other browsers don't treat
button.click() the same as their dispatchEvent(evnt), which is non-
intuitive. This was tested with Firefox and IE, IE doesn't support
dispatchEvent instead fireEvent. I want a real standard to call for
clicking a button via javascript, without conditional
statements. .click() is supported by the 2 main browsers but
implemented totally different.
Does anyone have an explanation for this behavior? I just want to know
if there is a real reason not to simply call the dispatchEvent(evnt)
from .click(). I'm not one to defend IE, but their .click() method
works, in my testing, just like their fireEvent() method. I'm not
sure why Firefox in this example treats the click() and
dispatchEvent() methods differently. I would guess security related,
but I'm not sure.
So Postback isn't javascript related, ok but what do you call when the
page refreshes in javascript terms? Just a Post? I am a .NET developer
but I was assuming Postback was a geneic web developer term.
-Jab