• General
    • Home
    • Contact Us
    • Privacy Policy
    • Sitemap
  • Photographs
    • 2018
    • 2017
    • 2016
    • 2015
  • Literature
    • Poems
  • News
    • Announcements
    • Charity
    • Legal
    • Medicine
    • Politics
  • Education
    • Code Samples
      • Basic
      • Simple
      • Intermediate
      • Advanced
      • Tips
    • History
    • Literature
    • Quotes
    • Videos
    • Vocabulary
  • Entertainment
    • Art
    • Humor
    • Photos
    • Video
  • Technology
    • Software
      • Support
      • Tweaks
    • Company
    • Science
    • Security
Major Mike

Knowledge is Power - Share the Power

Basic

Providing code samples that cover what are basic topics to solve programming needs for getting started and becoming familiar.

Display Sizes (Screen vs Available) [BASIC]

September 3, 2015 by GµårÐïåñ

As a programmer, often you need to either know the size of the user’s screen (basically their resolution); or the more important available space inside their browser where you can display your content. You avoid less clipping and display issues if you can distinguish the two.

function getWidth(){
	if(document.all){
        	return document.body.clientWidth;
	}else{
        	return innerWidth;
	}
};

function getHeight(){
	if(document.all){
        	return document.body.clientHeight;
    	}else{
        	return innerHeight;
    	}
};
document.writeln("Screen Size : " + screen.width + " x " + screen.height + " (Includes Everything on Screen)<br/>");
document.writeln("Width: " + getWidth() + " x  Height: " + getHeight() + " (What's Available INSIDE the Browser)");
DEMO | DOWNLOAD
Posted in: Basic, Education Tagged: basic level, code, JavaScript

String Reverse [BASIC]

September 1, 2015 by GµårÐïåñ

String manipulation is one of the most basic things you need to know.

	<form id="reverse" action="javascript:doIT()">
		<table>
			<th colspan="2">Reverse String</th>
			<tr>
				<td><input type="text" id="string" placeholder="enter a string" required /></td>
			</tr>
			<tr>
				<td class="button"><input type="submit" id="reverse" value="Reverse" /></td>
			</tr>
			<tr>
				<td><strong>LOG :</strong><br/><div id="log"></div></td>
			</tr>
		</table>
	</form>
	<script>
		function doIT(){
			var string = document.getElementById("string");
			var log = document.getElementById("log");
			log.innerHTML += "&emsp;" + string.value + " = " + reversal(string.value) + "<br/>";
			string.value = reversal(string.value);
		}
		function reversal(s) {
			var r = s.split("").reverse().join("");
			return r;
		}
	</script>
DEMO | DOWNLOAD
Posted in: Basic, Education Tagged: basic level, code, JavaScript

Show Your Support – We Don’t Believe in Disruptive Ads

Donate in one of two ways :
(BitCoin - preferred)
1BTshbqMSx5AHrDFLEa1YdPAy5EFzRSjr9
(PayPal)
January 2021
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Apr    

Semper Fidelis

Always Faithful, Always Forward
United States Marine Corp

Places to find me:

StackExchange profile for GµårÐïåñ at StackExchange

CodeProject

Twitter : verified ➠Follow

GitHub ➠Follow @GuardianMajor

ello ➠

deviantArt profile for GµårÐïåñ on deviantArt

Facebook i have made a personal choice after their "name policy" witch hunt which repeats every 2 years it seems at the whim of the "bully mob" (even when they make you jump through hoops and verify you), to just quit it and be done with it, they are not worth my time. I don't need it, I don't miss it, in fact it has made my life more productive and void of gross hate, vitriol and drivel. To those who say they can't stay in touch if I am not on there, if you can't reach me because I am not on Facebook, then you are not trying AT ALL - therefore, good riddance.

Scribd profile for GµårÐïåñ on Scribd

NoScript/FLashGot (Informaction) profile for GµårÐïåñ on Informaction Forums

Subjects

1949 1789 1934 1976 NASA England 1863 1955 1983 daily pic 1898 1985 annual 1776 1970 1914 1993 1995 1851 1991 1901 Germany 1933 1971 1918 1990 vocabulary 1942 1945 1969 1937 1958 United States Soviet Union 1961 1917 1865 1965 1911 1870 1962 1980 code 1944 1941 1812 1950 has_video 1916 1973 1889 1946 holiday 1963 1966 1960 1940 1986 1948 1974 1975 national park 2000 has_audio 1967 1972 1984 1964 1968 1935 1956 1952 New York 1978 1957 1954 1953 1979 event 1998 1989 1919 1959 1947 1943 1994 1908 1939 1951 1915 1902 1922 1977 1982 1981 history memorial 1846 1859 1938

Archives

Access Options

  • Register
  • Log in
  • Entries RSS
  • Comments RSS
  • ∞ Guardian International
🎔
Brought to You
by Guardian International

Copyright © 2007-2021 Major Mike | Privacy Policy | DMCA | Contact | About
fortitudo fortis defendit

McAfee SecureNorton by SymantecVirusTotal