Showing posts with label Google Drive. Show all posts
Showing posts with label Google Drive. Show all posts

Sunday, February 16, 2014

How to host CSS/JavaScript files on Google Drive



Did you ever think of writing your own CSS and JavaScript code and host it on the internet so that you may use it on your blog? Many geeky bloggers (well, I am not that geeky) and those who own free but customizable blogs (yes, like me) want to have their own widgets on their blogs. They want them to function exactly the way they wish to. Sometimes widgets imported from other blogs come with preset that may not suit our needs. So, for such bloggers it becomes essential to write their own scripts or edit the default ones. In both cases, you would need to upload your edited script files on some server and from there its link would be referred in the main widget code. But we on the boats of free service and with no server space can’t avail this facility to upload our files. Google Drive, the angel comes here to rescue. Google Drive is not just about uploading your necessary documents online but can also be used to host your script files which you may use to alter the widgets. Here I explain you how.

1) Upload your script file on your Google Drive.
2) Share the uploaded file and make it public.
3) Note down the URL of the file you just made public. It would be something like this: https://drive.google.com/file/d/0C4d6Av78BLPEfMUJWER9gtzdJdkE/edit?usp=sharing
4) Now copy the code of file (after https://drive.google.com/file/d/, and before /edit?usp=sharing) in our case it is this: 0C4d6Av78BLPEfMUJWER9gtzdJdkE
5) Just paste the code of file after this: https://googledrive.com/host/
In our case the final code will become: https://googledrive.com/host/0C4d6Av78BLPEfMUJWER9gtzdJdkE

And done, this final URL can be used anywhere on the internet now. You can use this to refer to external script for your widget.
For example, in our case the reference will be made as:
<script src="https://googledrive.com/host/0C4d6Av78BLPEfMUJWER9gtzdJdkE"></script>

If you find information here useful, please don't forget to 'share'. 'Like' my Facebook page and stay connected with trending topics here.


Image Courtesy: Google Images Search