Use of external javascript file

bigchris Jul 06, 2012 07:52PM EDT

Hello!

Below is my addthis code which I use on my website. I have a javascript file (that is, script.js) and would like to move the external javascript of my below addthis code (which I assume is the <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=0000000000000"></script> part) to my javascript file so as to minimize html file size and speed up page load times.

Is it ok to move the external javascript portion to my script.js file? Or is that not advisable / recommended?

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_counter addthis_pill_style"></a></div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=0000000000000"></script>
<!-- AddThis Button END -->

Up 0 Rated Down
Paul (AddThis Happiness Specialist) Jul 09, 2012 03:38PM EDT
We do not recommend removing that line because loading it from external JavaScript can cause unexpected problems. And, in any event, the script will still have to be loaded for the buttons to show up, so it won't decrease the page load time.

If you want to show the entire page before our script is parsed just move that JavaScript to just before the </body> tag.

This question is closed to new answers.

Still need help?


General Topics

 

Developers