How to Host JavaScript files on Google Drive

Google has added a new feature to drive: You can now serve up web content from within your Google Drive folder, even ones that run JavaScript. All you need to do is upload your HTML files and assets (e.g., images) and make them public.
Why to Host files on Google Drive?

  • Lots of Space: Google Drive provides you 5 GB storage to regular accounts so you can easily upload lots of documents. However, if your disk space is full, then you can upgrade your account from basic to premium.
  • Create & collaborate: Google Drive provides you the flexibility to create and host different kinds of spreadsheets and presentations. Make some edits in the documents and see real-time changes as they appear.
  • Reliable & Dependable: With 100% uptime, it provides you the freedom to host anything that you like. It has unlimited bandwidth, but you have to take care of your disk space it should not exceed 5GB mark or you can upgrade your account.
  • Go back and revise: Google drive tracks almost all the change that you make to your document – so whenever you will save a document, a new revision also gets save. You can take a glance back and can make revision accordingly.
  • Share or make files Private: You can share your files and folders with anyone. Select whether others can comment, share, view or edit your stuff. You can handle everything instantly from your dashboard.
  • Security at its best: Google Drive has always proven to be the most reliable free hosting service with unlimited bandwidth. Moreover, to provide full proof security Google drive has utilized HTTPS encryption to keep your documents secure.
  • All This For Free: All these impressive features for free.

How to Host JavaScript or CSS Files on Google Drive

Actually it is not so hard to use Google Drive, just create a folder, upload the JavaScript file (or any other file like images, videos, documents including PDFs and Microsoft Office files) and then change the file’s sharing settings from “private” to “public on the web”, or simply change the folder’s sharing settings from “private” to “public on the web” and all files inside that folder will have the same sharing permissions, but the tricky part is getting the proper direct link for the JavaScript or CSS files, so we can use it on the blogger template. Please follow the steps below to host your JavaScript or CSS file using Google Drive:

Step 1:

Login to your Google Drive account > Click Create > Select Folder

Step 2:

Type a name for the folder and click Create button

Step 3:

Select the folder and then click the Share button

Step 4:

Click on Change.

Step 5:

Change the sharing settings from “Private” to “Public on the web” > Click Save > Click Done

Step 6:

Now click on the folder’s name to go into it

Step 7:

Click the Upload button > Select Files & Click on Open.

Step 8:

Select file > Upload & Share

Step 9:

The item will have the same sharing permissions as the selected folder…. Click Upload and share

Step 10:

Copy the string characters after #folders/

Step 11:

Open a new browser tab > paste that string (folder id) into the address bar after yellow highlighted part here 

How to add an external JavaScript to a web page?

How to add an external CSS to a web page?


Leave a Reply

Your email address will not be published. Required fields are marked *