What is the best way to proceed?

  • 0
    There was a task to write a code for pop-up windows on sites in such a way that all the info that was clicked was sent to the database, and from the database to the tg bot, there are no problems with tg, but there are questions about how best to do this with js, since There are many sites and you need to make sure that the same script on these sites sends everything to a single database, and how to enter all this into the sqlite database?
    JavaScript Anonymous, Sep 13, 2020

  • 2 Answers
  • 0
    1) Create an API to which click requests will be sent from different sites.

    2) Generate pop-ups themselves via .js for easy integration into sites.

    3) In the integrated .js code, create a trigger for clicking on the window and send an AJAX request to the API.
    Anonymous

  • 0
    Everything is as the commenter said above, but AJAX most likely will not work due to cross-origin. Either you need to configure the server to receive any requests, or, as before, the tag
    Jacob Hutchinson

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!