728x90 AdSpace

Latest Article



Syntax Highlighter for blogger slow down the my site with Solution




Problem: When i am using Syntax Highlighter for blogger for nice view of code but  slow down the my site when open the new page,How to increase the performance of Syntax Highlighter  ?

Solution:
This Problem arise because of JavaScript load when page load first time.These jav ascript is loaded in html header following are the code mostly we use


<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPowerShell.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'></script>
<script language="javascript" type="text/javascript">
 SyntaxHighlighter.config.bloggerMode = true;
 SyntaxHighlighter.all();
</script>

I recommend you change the location of javascript files because so much load on http://alexgorbatchev.com site.

Best place to upload it on https://sites.google.com.

 Following steps to solve this issue:

 1.Create a site on https://sites.google.com.

 2.Create a New page and template type File Cabinet.




 Suppose you name the new page is "MyFiles".

 3.Add Files in "MyFile" File Cabinet Page.



4.Now path you use for your file is

 https://sites.google.com/site/usmanacademycom/myfiles

5. Replace all file path in header code.here is example code with above path



<link href='https://sites.google.com/site/usmanacademycom/myfiles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='https://sites.google.com/site/usmanacademycom/myfiles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shCore.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushCSharp.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushCpp.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushCss.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushJava.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushPlain.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushPowerShell.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushSql.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushVb.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/usmanacademycom/myfiles/shBrushXml.js' type='text/javascript'></script>
<script language="javascript" type="text/javascript">
 SyntaxHighlighter.config.bloggerMode = true;
 SyntaxHighlighter.all();
</script>

Syntax Highlighter for blogger slow down the my site with Solution
  • Title : Syntax Highlighter for blogger slow down the my site with Solution
  • Posted by :
  • Date : 12:31
  • Labels :






  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment