You might have hosted your codes in google codes, but now google codes has discontinued its service of uploading codes. So, as an alternate option, we can use Google Drive to upload our codes. Using a small trick, you can upload your codes to google drive and get a direct link of the uploaded code to use with web projects. Let's see how to host codes in google drive.
1. Login to google drive.
2. Now click "Upload" button and click "Files".
3. Now upload your CSS or JavaScript file.
4. After uploading the file, it will appear in your google drive. Just right click on the uploaded file and click Share > Share.
5. A window will popup now. From that window, click "Change..." link.
6. Now set the visibility option to "Public"and then click "Save" button.
7. Now, let's convert the link of the uploaded file into the direct link to use it in webpages to add external codes. Just copy the part of the code url as shown in the image below.
8. Now, replace the copied code with xxxxxxxxxxxxxxxxxxxxxxxxxx in the following code:
1. Login to google drive.
2. Now click "Upload" button and click "Files".
3. Now upload your CSS or JavaScript file.
4. After uploading the file, it will appear in your google drive. Just right click on the uploaded file and click Share > Share.
5. A window will popup now. From that window, click "Change..." link.
6. Now set the visibility option to "Public"and then click "Save" button.
7. Now, let's convert the link of the uploaded file into the direct link to use it in webpages to add external codes. Just copy the part of the code url as shown in the image below.
8. Now, replace the copied code with xxxxxxxxxxxxxxxxxxxxxxxxxx in the following code:
https://googledrive.com/host/xxxxxxxxxxxxxxxxxxxxxxxxxx
9. Now you have the direct link for your hosted code. To use it in your webpages, use the following codes:
For CSS : <link href='https://googledrive.com/host/xxxxxxxxxxxxxxxxxxxxxxxxxx' rel='stylesheet'/>
For Javascript : <script src='https://googledrive.com/host/xxxxxxxxxxxxxxxxxxxxxxxxxx' type='text/javascript'></script>
10. That's it. Enjoy web designing with google drive. :)
Keep visiting for more tips and tricks. Have a great time.
0 blogger:
Post a Comment