0

I am trying to get an function to run from an event listener on a form submit.

Chrome & Firefox (Iceweasel) work fine with this code. Internet explorer (Version 9) for some reason requires me to open up the developer tools and close it down straight away for the javascript to work, after the page can be refreshed and the code works fine.

The site is published at http://itdipext.ryanteck.org.uk/enquire.html and the javascript is at http://itdipext.ryanteck.org.uk/javascriptValidate.js

Why Internet Explorer 8?, Heck why javascript for basic form validation? This is for a college assignment where HTML5 does not even exist yet. And internet explorer to make the teacher happy.

Thanks - Ryan Walmsley

3
  • Please post the code that demonstrates the problem. Commented Jan 9, 2014 at 12:41
  • Its in the link of the javascript. Its 100+ Lines of code. Its not really the code its the browser! Commented Jan 9, 2014 at 12:41
  • stackoverflow.com/questions/7742781/… Commented Jan 9, 2014 at 12:47

1 Answer 1

1

It looks like its due to the heavy use of console.log in your script.

IE doesn't create the console object until dev tools is open. You can add this to the top of your script to stop it breaking

var console=console||{"log":function(){}};

Be aware it wont log anything to the console with this in place.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.