0

i have a iframe in a web page which is used to load a line graph made by d3.js. its working fine in all browsers except IE9. It is also working in IE9 once you press F12 and reload the page.then it renders the graph. I am not able to understand what is the problem.In first time of the page load the graph is not rendering and after that i press F12 and developer tool comes then if i reload or refresh the page the graph renders and works fine.

Can any body tell me what could be the problem?

Saurabh Sinha
  • 1,624
  • 3
  • 25
  • 51

1 Answers1

0

You probably have some calls to console.log() in your code. IE does not expose this method when the dev tools are closed, throwing an error that will cause your script to silently fail. When you hit F12, console.log() becomes available, and voila!, your code works. To solve this, you can either remove all calls to console.log(), or you can add a script to make your calls to console.log safe (credit to Michael Erickson):

if (!window.console) window.console = {};
if (!window.console.log) window.console.log = function () { };
Community
  • 1
  • 1
rdickert
  • 550
  • 5
  • 14