yyang5823
yyang5823

Reputation: 11

JavaScript function is not defined in external .js file in IE only

I use an external JavaScript file (.js) in a classic ASP program. I added a new function 'isFutureDate(dt)' to this file. The new function works fine when using Chrome browser to access the web page. When using IE 11, it showed the error of "isFutureDate() is undefined". Other functions in external .js are working.

I run into this type of problems several times recently. The existing functions in external .js file are working, but the newly added ones didn't work. I had to move those functions back to the ASP program, then they worked fine. My web server is IIS 7.5. I am not sure whether this issue is related to type of web server I am using.

I read several posts about problems with JavaScript function in external .js file. But, I have not found one that describe the same problem as mine.

Upvotes: 1

Views: 1272

Answers (2)

Shobhit Walia
Shobhit Walia

Reputation: 496

Hi Below are the root cause

  1. check the order of the Js file. it should be in correct order.

  2. If you are using multiple Js file. Use bundling because some browser have limitation of calling concurrent HTTP Call. if the limit exceeds it will stop rendering the script

  3. It should be the caching issue also open in Incognito window.

  4. last Debug using Inspect Element.

Upvotes: 1

Jon Nankervis
Jon Nankervis

Reputation: 21

I had a similar problem after company upgraded IE - answer: ensure the correct DOCTYPE is at the top of the page

Upvotes: 1

Related Questions