Wednesday, 15 February 2012

How to disable JavaScript function in html -



How to disable JavaScript function in html -

i looking disable javascript function within html code of online website. function checks see if radio button selected before beingness able parse info html tags.

i thinking of few options:

disable function, javascript ignored. change function display="block" display="none". write function create checked radio button , pretend same button. if none of above possible save page , parse info off-line.

since new javascript, expertise appreciated on , how approach issue.

here part of function:

<!doctype html> <html> .... <script> function disable_content() { if(!isradiobuttonselected('radio')) { document.getelementbyid('spamoverlayerror').style.display="block"; document.getelementbyid('spam_error').innerhtml="please provide flag" homecoming false; } if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.getelementbyid('rec_email').value))) { document.getelementbyid('spamoverlayerror').style.display="block"; document.getelementbyid('spam_error').innerhtml ="please fill valid email id."; homecoming false; } .... } .... function isradiobuttonselected(radiogrpname) { var radios = document.getelementsbyname(radiogrpname); var i; (i=0; i<radios.length; i=i+1 ){ if (radios[i].checked){ homecoming true; } } homecoming false; } homecoming ""; } </script> <body> .... <div class="flag_this" onclick="display_pop_up('light_spam');document.getelementbyid('spamoverlayerror').style.display='none';"> <input type="hidden" name="pagereload" value="yes" id="pagereload"> .... </body> </html>

noticed old post. if not resolved, may seek robg's solution, like:

... function disable_content() { homecoming false; } </script> ...

a cleaner approach searching html page find out part calls "disable_content()" function.

if in html like:

<button onclick="return disable_content()">blah, blah</button>

you can clean like:

<button>blah, blah</button>

if in javascript like:

var iscontentdisabled = disable_content();

you may remove or comment out javascript line , next references it, if any. utilize f12 developer tool (chrome/ie) or firebug (firefox) debug ensure changes don't break else.

javascript html

No comments:

Post a Comment