Home > Blockchain >  Getting the information of the site with the script tag added with Javascript [closed]
Getting the information of the site with the script tag added with Javascript [closed]

Time:10-08

I'm not talking about pulling data from another site.

I am trying to make a micro saas tool.

When someone copies the script code and adds it to their site, I want to pull the title, link and meta tag image of that site.

And I want to retrieve and process that information with GET.

That's all.

CodePudding user response:

You can see the url of the site the js is working on with window.location.href. The title comes from document.title.

To make requests in JS it's recommended to use the fetch API. https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

  • Related