FANDOM


  • Is this possible? Let's say I have some site JS that retrieves some data (ex. using api.php). Is there a way to save this data as a file to the local machine? I have tried searching online and it doesn't look like it is possible without additional libraries. Yes, there are data URIs but most places I looked said those aren't a good idea for large sets of data.

    An unrelated but quick question:

    Can you import Lua modules from places other than this wiki and the local module namespace?

      Loading editor
      1. https://stackoverflow.com/a/30832210 and https://stackoverflow.com/a/58484441 you need to create a with .href=canvas.toDataURL and .download=imagename, then just do a.click
      2. nope. and, in general case, you should not: imported module might be changed or even deleted at any time. on the dev wiki, all changes in the module will (at least try to very hard) keep backward compatibility.
        Loading editor
      1. I see. So data URI + download attribute is the only way to do it. Not the answer I was hoping for but at least now I know.
      2. Makes sense. I was just wondering because I was curious if you could do personal modules (like how you have personal JS) or import modules from the Templates Wiki.
        Loading editor
    • Andrewds1021#3
      if you could do personal modules

      like Module:Sandbox/Andrewds1021/mypersonalmodule? you will be able to import the module on any wiki.
        Loading editor
    • I didn't think of that. Now that I think about it more though, the idea of personal modules is a bit stupid anyways.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+