issue #3541 : Fix a bug when loading js from server.