Monday, 9 June 2014

How To Host JavaScript And CSS Scripts On Google Drive

SOCIALIZE IT →

Embedding JavaScript and CSS files in your blogger template or any page of your blog instead of writing all the script in your template has an advantages to prevent to clone your template. However more external JavaScript and CSS files are not good for template and SEO but you can host 2 to 3 external files with your template. You must have Gmail account to access google drive and who is using blogger then he must have gmail account.


  • Log in to your Gmail account and open drive.google.com
  • Click on the upload button and choose file to upload and choose your JavaScript or CSS file which you want to host on Google Drive.
When Upload is complete click on Share link.

Sharing setting will be open and you'll get the file link. You need to change the privacy of file from only you to public.
In access option change from private to public.

here is the file url which we copied.

https://drive.google.com/file/d/0B9brGLrh9B3yY0E3WEJUN1JxbDg/edit?usp=sharing

0B9brGLrh9B3yY0E3WEJUN1JxbDg it is the unique ID of your file.This is the ID which we need. Now change the link to:

https://googledrive.com/host/0B9brGLrh9B3yY0E3WEJUN1JxbDg

How to Embed External javascript or CSS Files.
We all learn about the topic but this is the code which we need to put in the template to host external Jaascript or CSS files.
Embed CSS Files.
<link rel="stylesheet" href="CSS_file_link"/>
To Embed Javascript files
<script src="JavaScript_file_link"></script>
You are done :) 
Get Free Updates in your Inbox
Follow us on:
facebook twitter gplus pinterest rss





0 comments:

Post a Comment