I want to write logs from browser side JavaScript to static site hosting server

Asked 2 years ago, Updated 2 years ago, 32 views

I am running JavaScript which is located on the rental server, and I would like to print the value obtained by running JavaScript to the log on the server.
As it is a rental server, there are restrictions and I think only JavaScript or HTML is available.

  • The server is the FC2 home page
  • CGI is not available
  • Access logs are also unavailable

Please let me know if there is any good way.

javascript html

2022-09-30 10:54

1 Answers

It's impossible.
If the server side does not have a mechanism, the client side (web browser) cannot write to the server's files or run programs on the server.

It is possible to prepare a server separately from the server where JavaScript and HTML are located, and to request something from JavaScript to the other server.
If you do this, you don't need to move the server that you're publishing now.
In the end, however, you will still need to rent a server that has more freedom than your current rental server or use a service like PaaS.

I don't know the details of what I want to log, but maybe it's something I can get from services such as Google Analytics.


2022-09-30 10:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.