I
I
ILYA2016-12-28 10:26:14
JavaScript
ILYA, 2016-12-28 10:26:14

Why is the js file not fully loaded in the browser?

From time to time there is a problem, the js file is not fully loaded. As a result, you can see an error in the console

SyntaxError: Unexpected end of input
and actually by the contents of the js file it is clear that it was only partially loaded.
Request like: //server/files/file.js?234234

What is the reason and how can I fix it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
ckr, 2016-12-28
@iliacmd

The server is probably not sending the Content-Length header correctly.
This happens when there are utf-8 characters in js. For example, Content-Length sends the number of characters, but you need to send the number of bytes

D
Dmitry Eremin, 2017-05-31
@EreminD

Have you looked in the debugger?
By the time "Serializer.SetData(filePath, data);" what is in data?
And what is a Serializer?
Maybe in a standard way ( https://msdn.microsoft.com/ru-ru/library/system.xm...
Or is it its own wrapper? Then you need to look into it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question