18 February 2010

Upload/host all Javascript or .js files on Blogger with unlimited bandwidth

Advertisements

[javascript.jpg]
(image source -http://commons.wikimedia.org/wiki/File:Wikibooks-javascript.png)

When you are using any widget you have to upload JavaScript or .js file to your server. Because if you use the JavaScript link from the widget code, will face a bandwidth problem. This may result in non working of widget or slow loading of your blog.  e.g.

<script src='http://sites.google.com/site/freebloggerhelpbiz/freebloggerhelp/relatedposts.txt' type='text/javascript'/></script>

You can see above code in most of the widget codes you use.In above code relatedposts.txt is the JavaScript or .js file. Also http://sites.google.com is the website where that JavaScript file is hosted. If lots of people use the same above link then it will cause bandwidth problem. And widget will not work.

Therefore you have to Download that JavaScript file (e.g. http://sites.google.com/site/freebloggerhelpbiz/freebloggerhelp/relatedposts.txt) and then upload to your server like Google pages or sites.google.com that are free but have bandwidth problem. There are some servers with unlimited bandwidth but they are not free.
 Then what is the solution without bandwidth restriction and is free. Here it is. Use a simple trick to host your JavaScript on your Blogger itself.

I am going to explain this with example of Related Post Widget.

The JavaScript code is


<script src='http://sites.google.com/site/freebloggerhelpbiz/freebloggerhelp/relatedposts.txt' type='text/javascript'/></script>


Download your JavaScript file (e.g. http://sites.google.com/site/freebloggerhelpbiz/freebloggerhelp/relatedposts.txt).

Now just replace above JavaScript code with

<script type='text/javascript'>
//<![CDATA[
Paste all code here from .js file
//]]>
</script>

Now open the downloaded JavaScript file and Copy all the text in that file and Replace it with Red text from above code.

This way you will never face bandwidth problem.

UPDATE    Upload/host Javascript Or .js files to Google Sites?

Related Posts

6 comments

February 18, 2010 at 7:59 PM

very cool & good tip, thank you very much for sharing.

Anonymous
March 6, 2010 at 7:22 AM

Good TIps & Tricks

The Above Trick Will Work Up TO 1gb of Bandwidth
after that you have to create a blogger with another ID or Different Id. From There You Can Use It.

Thanking You

Mobilesstore.TK

February 12, 2011 at 10:05 PM

How to use ?ver=2.85 while hosting file in blogger itself? for example a file like this:
http://bloganol.com/blogger/templates/gazette edition/js/scripts.js?ver=2.8.5

February 12, 2011 at 11:58 PM

Open
http://bloganol.com/blogger/templates/gazette edition/js/scripts.js?ver=2.8.5

and copy all the contents from it and paste it as bellow

<script type='text/javascript'>
//<![CDATA[
Paste all code here from .js file
//]]>
</script>

February 13, 2011 at 10:16 AM

but its not working..

February 14, 2011 at 1:14 AM

You have to use following code

<script type='text/javascript'>
//<![CDATA[
Paste all code here from .js file
//]]>
</script>

INSTEAD

<script src='http://bloganol.com/blogger/templates/gazette edition/js/scripts.js?ver=2.8.5' type='text/javascript'/></script>

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More