JavaScript file is not loading fully in all browsers

痴心易碎 提交于 2019-12-13 05:16:25

问题


I see this strange behavior (or may be I am missing something). I have WebSphere 8.5. Deployed a EAR. Its working fine.

Instead of repacking and deploying every time for small change, I just copy the js and CSS files directly to the Websphere exploded folder and overwrite the existing files. I see the changes are getting reflected.

I just updated a JS file and added a couple jQuery functions and copied the file like above. Now when I refresh the page, I see the updated code (which is somewhere in the middle of the file). however the js file is not loading fully in all 3 browsers (IE8, Chrome and FF latest). It's getting cut off in the last 10 lines are so.

The file has 1784 lines. Not sure if there is a size limit on the browser side or WebSphere is tinkering with it or something else is going on. Any idea?

I did check the js file I copied to Exploded WebSphere folder. It has complete code.

Note that the page has a few more JS files (jQuery and other files) in addition to this one.

Edit:

I think WebSphere is keeping the size of the file somewhere (maybe?) and sending only that size every time, unless there is clean deploy or restart (?).

I removed a few lines of updated code. Now the browser loads, exactly that many number of additional lines of code. Once I remove my code completely, it loads the full file. (This is not an issue with the code though).

Is there a caching that I need to clear in WebSphere?


回答1:


Check this page it Hot deployment and dynamic reloading. In general it says that you may need to restart the application.

Also check, if application reloading is enabled, however I'm not sure if it is relevant for static files.

If reloading of classes is enabled and the polling interval is greater than zero (0), the application files are reloaded after the application is updated. For JavaServer Pages (JSP) files in a web module, a web container reloads JSP files only when the IBM extension jspReloadingEnabled in the jspAttributes of the ibm-web-ext.xml file is set to true. You can set jspReloadingEnabled to true when editing your web module's extended deployment descriptors in an assembly tool.

You can restart app from console as provided in comments or via wsadmin script.



来源:https://stackoverflow.com/questions/25769258/javascript-file-is-not-loading-fully-in-all-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!