2

For my list I have created a custom NewForm.aspx and EditForm.aspx that uses a custom stylesheet and javascript/jQuery with spservices.

The page works wonderfully in Firefox. But when I open the page in Internet Explorer I can see that the javascript does not run when the page is opened.

I tried loading the page whilst skipping the cache via ctrl+F5 and it doesn't help.

If I open the Developer Tools to debug it, the page immediately begins to work!

In my master page I have set the document-mode to IE8. And in Developer Tools I see that it is running for the default mode, which is IE8.

It almost seems like IE is not loading jQuery. But I've no way to debug it; as soon as I enable Dev Tools in IE everything works.

What can I do to fix this?

Here are the dev tools settings:

Dev Tools Settings

  • can you show your code? – Mike Dec 24 '15 at 17:11
  • Well, yes, I can, but I'm not sure it is a code issue. It works in IE if F12 Tools are enabled, but not when they aren't. There are no javascript errors in the console. – bgmCoder Dec 24 '15 at 17:25
  • 1
    and what isn't working correctly? – Mike Dec 24 '15 at 17:31
  • Hmmm. How do I make this more clear? When the page loads in IE, the javascript will hide/show certain elements on the page, but I can see that the elements are not being affected by the javascript. Only in IE. And only if the Developer tools are not enabled. So, in the CSS I mark some elements as hidden and use those css styles in the NewForm.aspx but certain ones are supposed to show on certain conditions, and they do not show like they ought to - but only in IE with dev mode off. – bgmCoder Dec 24 '15 at 17:39
  • I really hate Internet Explorer. – bgmCoder Dec 24 '15 at 17:40
14

Delete all the console.log lines from your script. It errors out until the console is open, which is why it suddenly works when you open the console

0

If You mean SharePoint - try to use

_spBodyOnLoadFunctionNames.push("yourfunction");

instead of

SP.SOD 

Helped me in SharePoint Online.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.