1

Server A: Windows Server 2008 R2, IIS 7, admin - me

Server B: Windows Server 2008 R2, IIS 7, admin - company server admin group

I have a Javascript file that works well on my local machine. The JS file also works on Server B. When loaded to Server A, the page returns the error "Unspecified error" with a go to line that doesn't mean much in either the HTML or the JS. When replaced with a JQuery file, that also works locally, and also works on Server B, I get a different error "Object Expected" again with a meaningless go to line.

There are bits of Javascript which are functional on the same site on Server A, so JS is not completely disabled.

I am aware that JS and JQuery are considered client-side languages, but in this case "Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth."

Are you, server fault'ers, aware of server configurations that would affect Javascript/JQuery performance?

Mark
  • 11
  • 1
  • 2

3 Answers3

2

What this probably means is that the server isn't returning the correct data when the .js file is requested.

It's called a client-side language because it is a client-side language; the javascript files are not executed in any way on the server; they're just text files with a different MIME type as far as it cares.

In Firebug or Chrome's dev tools, take a very careful look at the responses to the requests for the .js files when requested from both servers. Something's different between them.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
0

I'd guess that IE Enhanced Security Configuration (IE ESC) is enabled on Server A. You can turn it off from the top level of the Server Manager MMC.

And the server doesn't usually need to be able to run javascript in order to just serve it up to clients.

TristanK
  • 9,073
  • 2
  • 28
  • 39
0

This problem was encountered with IIS-8 with Chrome 63.0.3239.132 failing to load jQuery for DataTables. Files and code were downloaded from the DataTables site (DataTables styling with JQuery 3 and DataTables packages - no min no concatenate) then uploaded to directory mapped to an IIS site to make a static site with only HTML and JS. The jQuery worked when viewed locally on the server using Internet Explorer. The jQuery threw errors when viewed on another computer on the network using the full address for the server due to the jQuery script not being loaded by the browser. IIS works. The basic HTML loads. jQuery broke.

To fix the problem the files were saved as UTF-8 by opening them on the Windows Server 2012 machine in notepad then Save As and select encoding UTF-8. Point the HTML as the UTF-8 version of the files and jQuery works.

Errors thrown included:

Expected identifier

Expected identifier, string or number

'jQuery' is undefined

'$' is undefined

A similar error was thrown when the JavaScript script src target was not pointing to a valid JavaScript .js file.

Underverse
  • 103
  • 1
  • 1
  • 8