justAnoob Posted December 20, 2009 Share Posted December 20, 2009 Safari and Chrome. IE and FF everything is fine. Just in Safari and Chrome I can physically see my js which throws off my whole page. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/185792-js-code-displayed-on-my-page-only-in/ Share on other sites More sharing options...
ignace Posted December 20, 2009 Share Posted December 20, 2009 It might help posting some actual code Quote Link to comment https://forums.phpfreaks.com/topic/185792-js-code-displayed-on-my-page-only-in/#findComment-981054 Share on other sites More sharing options...
justAnoob Posted December 20, 2009 Author Share Posted December 20, 2009 Here is a part of it. My homepage has the exact same js validation script, and my homepage displays fine on Safari and Chrome, but when I go to another page on my site(with the same js) it displays my code. <script type="text/javascript"/> function validate(form1) { var valid = true; if (!form1.item_name.value) { document.getElementById('item_name_error').innerHTML = '*'; valid = false; } else { document.getElementById('item_name_error').innerHTML = ''; } return valid; } </script> Quote Link to comment https://forums.phpfreaks.com/topic/185792-js-code-displayed-on-my-page-only-in/#findComment-981071 Share on other sites More sharing options...
ignace Posted December 20, 2009 Share Posted December 20, 2009 <script type="text/javascript"/> <-- remove the / Quote Link to comment https://forums.phpfreaks.com/topic/185792-js-code-displayed-on-my-page-only-in/#findComment-981104 Share on other sites More sharing options...
justAnoob Posted December 20, 2009 Author Share Posted December 20, 2009 thanks Quote Link to comment https://forums.phpfreaks.com/topic/185792-js-code-displayed-on-my-page-only-in/#findComment-981127 Share on other sites More sharing options...
trq Posted December 20, 2009 Share Posted December 20, 2009 You can simply use.... <script> browsers don't read the type declaration anyway. Quote Link to comment https://forums.phpfreaks.com/topic/185792-js-code-displayed-on-my-page-only-in/#findComment-981175 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.