Thursday, March 12, 2015

What is source code? What do they do?

Source codes are codes written to do something. There are many types of source code for various purposes. In the case of the Internet and if your are using a blogging platform like Blogger.com for your blog, the source codes are meant to be read and interpreted by browsers (Google Chrome, Firefox, Internet Explorer, etc.) and instruct them to display what the coder want the browser to display on your computer screen.

Below is an example of a small section of the source code used to display what you see now on your screen. Do you need to understand what all those "gibberish" means? Not exactly, it is meant for browsers and browsers are not human (coders/programmers are also "not human" but they need to understand how to write the source codes for the browsers)

Although you don't need to be an expert on source code, it will be good for you as a blogger to know a bit about HTML (which is one of the source codes for the Internet). For example, you want to put in your blog post a link for your visitors to click to take them to elsewhere such as to my Blogger for Dummies blog.

The source code for the above link is as follows;
<a href="http://bloggerfordummies.blogspot.com/">Blogger for Dummies</a>

And if I want the link to open in a new tab/window, all I need to do is to add an attribute target="_blank" or target="new" like this
<a href="http://bloggerfordummies.blogspot.com/ target="_blank">Blogger for Dummies</a> blog

Note that to do the above in your blog post, you will have to do it in the post editor in HTML mode.

And if you are interested in displaying advertisements like AdSense ads, what you have to is to sign into google.com/adsense, get the codes for the ads from their dashboard then go to
Dashboard > Layout > Add a gadget > Add a HTML/Javascript gadget
and paste their codes there.

Example of source code used to display this blog on your computer screen


<!DOCTYPE html>
<html class='v2' dir='ltr' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/>
<meta content='width=1100' name='viewport'/>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
<script type="text/javascript">(function() { var b=window,f="chrome",g="tick",k="jstiming";(function(){function d(a){this.t={};this.tick=function(a,d,c){var e=void 0!=c?c:(new Date).getTime();this.t[a]=[e,d];if(void 0==c)try{b.console.timeStamp("CSI/"+a)}catch(h){}};this[g]("start",null,a)}var a;b.performance&&(a=b.performance.timing);var n=a?new d(a.responseStart):new d;b.jstiming={Timer:d,load:n};if(a){var c=a.navigationStart,h=a.responseStart;0<c&&h>=c&&(b[k].srt=h-c)}if(a){var e=b[k].load;0<c&&h>=c&&(e[g]("_wtsrt",void 0,c),e[g]("wtsrt_","_wtsrt",h),e[g]("tbsd_","wtsrt_"))}try{a=null,
b[f]&&b[f].csi&&(a=Math.floor(b[f].csi().pageT),e&&0<c&&(e[g]("_tbnd",void 0,b[f].csi().startE),e[g]("tbnd_","_tbnd",c))),null==a&&b.gtbExternal&&(a=b.gtbExternal.pageT()),null==a&&b.external&&(a=b.external.pageT,e&&0<c&&(e[g]("_tbnd",void 0,b.external.startE),e[g]("tbnd_","_tbnd",c))),a&&(b[k].pt=a)}catch(p){}})();b.tickAboveFold=function(d){var a=0;if(d.offsetParent){do a+=d.offsetTop;while(d=d.offsetParent)}d=a;750>=d&&b[k].load[g]("aft")};var l=!1;function m(){l||(l=!0,b[k].load[g]("firstScrollTime"))}b.addEventListener?b.addEventListener("scroll",m,!1):b.attachEvent("onscroll",m);
})();</script>

No comments:

Post a Comment

Find help, info, instructions, tips, tricks

Tip: Use search box below or this box, labels in the first right sidebar, archive, ctrl+F for this page or sitemap to find topics