P
petermichaux
Hi,
I'm trying to do the right thing. I currently have a page that doesn't
have any JavaScript and the page works. The page works with CSS on or
off. Now I would like to add some JavaScript to enhance the page. The
JavaScript will rearrange some of the DOM and use CSS.
I am willing to put in the effort to try to ensure that the JavaScript
doesn't do anything if necessary JavaScript support for full
functionality is not available. This seems like a difficult task. I
will do the DOM rearranging onload but before doing this rearranging I
will have to check that even the code in the event handlers will work.
Like I will have to do something like this
if ( /* check every function I need is available */ ) {
// All my JavaScript here
}
Is the best way to do this?
It would be an equal failure if the JavaScript does anything if the CSS
is disabled. Can I check that the CSS is on?
Thank you,
Peter
I'm trying to do the right thing. I currently have a page that doesn't
have any JavaScript and the page works. The page works with CSS on or
off. Now I would like to add some JavaScript to enhance the page. The
JavaScript will rearrange some of the DOM and use CSS.
I am willing to put in the effort to try to ensure that the JavaScript
doesn't do anything if necessary JavaScript support for full
functionality is not available. This seems like a difficult task. I
will do the DOM rearranging onload but before doing this rearranging I
will have to check that even the code in the event handlers will work.
Like I will have to do something like this
if ( /* check every function I need is available */ ) {
// All my JavaScript here
}
Is the best way to do this?
It would be an equal failure if the JavaScript does anything if the CSS
is disabled. Can I check that the CSS is on?
Thank you,
Peter