Hello,
I am trying to work out the usage of preventDefault( ) and not having
any success.
The scenario is that I want to add on onclick handler to a link. When
the onclick handler fires, I want action A to take place, which will
be a request. I want to insure that action A completes before the
click to the link retrieves the page. To do that, I would like to
issue a preventDefault( ), wait for action A to complete and then
direct the browser to the page specified in the link (e.g., set
location.href=" clicked_link_re f").
I just cannot find any practical information that leads me to a way to
do this. I have googled and read the O'Reilly book on JS and the JS
cookbook, as well. I haven't been able to backtrack from their
examples to a solution to my own problem.
Any help would be much appreciated.
Thanks.
mp
--
'cat' is not recognized as an internal or external command,
operable program or batch file.
I am trying to work out the usage of preventDefault( ) and not having
any success.
The scenario is that I want to add on onclick handler to a link. When
the onclick handler fires, I want action A to take place, which will
be a request. I want to insure that action A completes before the
click to the link retrieves the page. To do that, I would like to
issue a preventDefault( ), wait for action A to complete and then
direct the browser to the page specified in the link (e.g., set
location.href=" clicked_link_re f").
I just cannot find any practical information that leads me to a way to
do this. I have googled and read the O'Reilly book on JS and the JS
cookbook, as well. I haven't been able to backtrack from their
examples to a solution to my own problem.
Any help would be much appreciated.
Thanks.
mp
--
'cat' is not recognized as an internal or external command,
operable program or batch file.
Comment