Welcome to my blog :)

This is a site comprised of a personal collection of notes and information serving as a single reference place for examples, tips, codes, testing, instructions, workarounds and troubleshooting with a record of external links to help during web design or managing and maintaining mobile devices and PC. I'm not a novice nor an expert...just a LittleBitGeeky here on blogspot.com

Friday, October 14, 2016

PC: How To Have Computer Read Word and PDF Documents Out Loud (Text to Speech)

Stop looking for 3rd party computer app's to read text out loud! The simple solution is to just use the Speak Command in Microsoft Word and use Adobe Reader to read back PDF documents.

There are a few TTS (text to speech) apps available in the Microsoft store, but I didn't like certain features, or lack thereof,  and what the reviewers had to say. Plus, all the ones I looked at worked by a "copy & paste function" into the app itself.  For my own purposes, I want to proof read my novel, so this function was not appealing. Likewise, it would not be an efficient or convenient method for lengthy student papers or anyone writing long articles.

After doing more research, I discovered that TTS is already a built in function of Microsoft Windows. It just needs to be turned on!

HOW TO ADD THE SPEAK COMMAND IN MS WORD:

For Windows 10, simply add the built in TTS function in MS Word to the quick access toolbar to activate the speak command.

1) Open MS Word.
2) Click the arrow on the "Quick Access Toolbar" at the very top of the screen for options to customize the toolbar.
3) Choose "More Commands" from the drop down menu
4) Switch view from "Popular Commands" to "All Commands"
5) Click "Speak" command and hit the "Add" button to add it to the list of tools.

HOW TO USE THE SPEAK COMMAND:

1) Highlight any or all text in the document. Right click the mouse and drag over a desired section you want the computer to read back to you, or use CTRL+A to select the entire document.

2) Click the newly added "speak icon" on the quick toolbar. It will be a callout bubble (like in a comic book) with a small arrow beside it, that is labeled "speak selected text" when hovered.

3) Sit back and listen while the computer reads the text to you.

HOW TO ADJUST VOICE: 

Change the talking speed, adjust the tone of the computers voice or switch from male to female speaker. Go to start / settings / type "narrator" in the search box


ADVANTAGES OF 3RD PARTY TTS APPS:

Pros: Some apps may have the option to save the copied text into MP3 format for whatever purposes you desire. Some apps can be installed on your Android as well as the PC. All apps can read any text from any source that can be copied, so includes websites, PDF's and just about any documents.

Cons: First and foremost, the most annoying thing is that you have to manually copy and paste text into the app itself. Others include voices that sound like a robot, some read too slowly or doesn't recognize punctuation correctly, some doesn't read the text entirely and some may cause crashing to occur.

ADVANTAGES OF MS WORD SPEAK COMMAND:

Pros: Easy. Just highlight text and click the icon for read back. Pleasant sounding voice, which can be altered to suit your preferences. Can read multiple languages. No extra 3rd party applications need to be installed which I value because I believe that "less is best".  I keep extra programs installed to a minimum in an effort to keep my system background running clean and smooth.  

Cons: Only for use in MS Word Documents. Alternatively, you could copy and paste text from any other source into Word to utilize the Speak Command. It would be the same as using a 3rd party app.


HOW TO READ BACK PDF DOCUMENTS:

Adobe Reader, which most of us already have installed on our system, also has a Speech to Text option and likewise, must be activated to use its built in function.

1) Open the PDF file in Adobe Reader
2) Menu / View / Read Out Loud / Activate Read Out Loud
3) Click a paragraph to have the computer read it back
4) Or select other control options in the Read Out Loud Menu like read to the end of document and pause or stop

Note: Adobe browser extensions may need to be disabled. More research is needed at this time.

Tuesday, October 4, 2016

Google Calendar Not Syncing with Android Phone [solved]

The Problem:

All of a sudden, my Google Calendar on PC would not sync with my Android app on my Samsung Galaxy smartphone. It didn't matter if I was on Wifi or 4G data either. I've been using this calendar on both devices for many many years and with several different phones, and have never had this problem.  Yes, it always need more features or options, but it's always faithfully synced...until now.

I have spent hours, even days on searching for a solution and I've read about all different kinds of fix's in Android forums that just really make no sense to me, ie uninstalling Facebook or downloading some 3rd party sync app.  A light bulb went off over my head one morning and I figured out a simple solution on how to regain calendar sync on my own.

The Fix: 

Simply TURN OFF POWER SAVING MODE on the Galaxy phone, then hit "sync now" in the calendar menu. Thats it! The issue is resolved.

The Cause:

I have noticed that several operations on the phone are disabled when power saving mode is turned on. There is even a message that pops up when you do turn it on. It seems to me that particular functions that are affected have changed after a major operating system update, because my calendar always synced before no matter what my power saving settings were. In any case, turning off power saving mode on my Galaxy phone and manually syncing has solved the problem.

Saturday, September 20, 2014

Web Design: Search Engine Optimization SEO


SEO-Search Engine Optimization for High Ranking
Methods and Important Development Factors to Optimize Website

It is known that users typically don't look past the 2nd page on search results, if not just the 1st page alone. Page one is the top 10 ranking sites and page two is the top 20 raking sites. The importance of correctly developing the right type of website is of great value in respect to your sites ability to move up the ranking ladder.  Structure of the layout design, accessibility and validity to web robots are key ingredients for a successful top ranked website.

Author: Karen Grady

Sources:
Google SEO Optimization Recommendations Guide
     Download PDF
Google Webmasters Guide
     -https://www.google.com/webmasters/tools/home?hl=en
     -Submit Website to use Webmaster Tools:
     -Submit Canonical Domain & Submit XML Sitemap for crawlers


Table of Contents: 
About Search Engine Ranking
Factors of Search Result Ranking
Outline of Individual Factors


About Search Engine Ranking: 


There is no guarantee that your site will automatically rank first for queries in Google, but with certain methods implemented into the web design itself (SEO-Search Engine Optimization) will allow the search engines (SE) to crawl, index and understand your content in the best way possible. Thus this will increase your chances of being at the top portion of the search result list. "Organic" search results are ones that occur "naturally". SEO in the web design affects only organic search results, not paid or "sponsored" results, so that's what I focus on.  Technical details are listed below in the SEO Area's of Concentration section.

Moreover, companies or sites that claim to guarantee high ranking typically employ deceptive tactics to fool the search engine bots, and if your domain (website name) is affiliated with such site, your site could be banned from the Google index permanently. One example is comment spammers, like when an advertisement for Viagra is added to the comment box with a link to that site. This can actually hurt your sites reputation, thus is the reason behind using image Captcha's when public comments are allowed or why most sites require users to sign up for an account in order to comment.

Factors of Search Result Ranking:


Listed in chronological development order, are the main factors that directly effect search engine ranking, which if done correctly will promote your website to a higher rank or inadvertently hurt your website if the web robots read the wrong type of data and/or is corrupted by external entities.

1) First and foremost, is optimizing the website design to specifically target search engines in order to validate your site to gain the proper reputation status for your site. Important design features are applying the correct data values to HTML [via tags like <title>, <meta descriptions> and <!DOCTYPE>], organizing and naming the file structure itself to produce "friendly" URL page addresses, site map  hierarchy order, accessibility from any device or user settings and correctly configuring the layout to making sure that mobile search engine robots recognize the site as valid and trustworthy.

2) Submitting the site (and specific siteMap.txt document) to each search engine initially lets the site presence be known, thus minimizing the initial wait time for search engines to "find" your site.

3) Actual site traffic,  the more hits the higher the value.

4) Links to and from the site, to/from other reputable websites promotes your own site's reputation.


Outline of Individual Factors:


1) HTML HEAD: TITLE AND DESCRIPTION META TAG 

<title> 
-The contents of the title tag will usually appear in the first line of the results, words appear in bold that match search sting.
-Use a short to the point title and apply a unique title to each page.
-Place in the head section of a HTML document.
<meta name="description=" content="....">
-Add one or two sentences or a short paragraph fully describing the page and apply a unique description to each individual page. This is the default display that's positioned below the title. Or alternatively, the display will return be a more relevant section of the page that more correctly matches the search sting query.
-Place in the head section of a HTML document.
Example of Both:<html>
<head>
<title>Brandon's Baseball Cards - Buy Cards, Baseball News, Card Prices</title>
              UNDERLINED SEARCH RESULT TITLE<meta name="description=" content="Brandon's Baseball Cards provides a large selection of vintage and modern baseball cards for sale. We also offer daily baseball news and events in">
              DISPLAYS UNDER THE TITLE</head>
<body>


2) HTML HEAD:  KEYWORDS
-DO NOT USE KEYWORDS ANY MORE!
-Google and Bing crawlers could deem your site as SPAM and be omitted from search results.


3) FILE STRUCTURE FOR URL PAGE ADDRESSES:  
-Allows web crawlers like Googlebot to index URL'S efficiently.
-Friendly Folder and File Names create user friendly URL's .
-Google suggests using hypens vs underscores.

File: The Site Map Inclusion Protocol = "sitemap.txt"
-https://support.google.com/webmasters/answer/183668?hl=en
-A special file created to submit your website and get your web pages indexed by search engines
-Build a sitemap in a standard XML file and submit to Google
XML Example:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/foo.html</loc>
</url>
</urlset>
-or use 3rd party tools to generate the file. Here's a list https://code.google.com/p/sitemap-generators/wiki/SitemapGenerators
-Break up a large sitemap into a set of smaller sitemaps to prevent server overload. A sitemap file has 50,000 URLs limit and 50 MB uncompressed size.
-Use a sitemap index file to list all your sitemaps and submit this single file to Google rather than submitting individual sitemaps.


File: The Robots Exclusion Protocol="/robots.txt"
-Meaning a "suggestion" for bots to Do Not Crawl this page
-Example: User-agent: * Disallow: / tells All Robots that it should not visit any pages on the site.
-Example: Disallow: /tmp/ or Disallow: /junk/ excludes all robots from only these parts of the server
-Use other methods to secure sensitive information as this robots.txt file is a public file.
-It is not to be used to try and hide information.
-Should be placed in the top-level directory of your web server so the URL is http://www.websitename.com/robots.txt.

4) URL ACCESSIBILITY STRUCTURE: 

*All pages have a min of one static access link
-Note that Dynamic generation of documents can result in small changes because of counters, timestamps, or advertisements.
*Test Spider Accessibility on the Site
-using Lynx Screen Browser.
-Web crawlers basically see what screen readers see.
-Ensures site will display without JavaScript or other coding.
*Canonical Domain Page Structure for Multiple URLs
-The preferred domain is the version that you want used for your site in the search results.
-Sets www or http:// as the preferred version for Search Engines to use, no matter what version is accessed.
-Sets one page as main from its IDENTICAL content twin
-i.e. text only or printer friendly versions.
-(does mobile sites apply?)
-Do not link to same page from root directory and from subdomain, i.e. "domain.com/page.htm" and "sub.domain.com/page.htm"
-Warning about using this wrong! Mainly use rel=canonical for dynamic urls, eCommerce with filtered lists, syndicated content like someone else using your content on their page, which they would all the rel link.
-<topHead link rel="canonical"> is merely a hint, not an actual redirect.
-Preferred method vs rel link is to set up a 301 redirect from dup pages to dominant page
*Mobile Searches: are a separate entity and must be submitted to SE Separately
-Submit its own sitemap to let its presence be known
-A mobile <!DOCTYPE> must be declared.

*Dual SiteMaps: One for user, One XML to submit to Google for Crawlers
-Note that a 3rd one needs to be created and submitted separately to Google if using a separate mobile site
*Mobile Sites: 2 different sites with 2 separate URL's
- /m/ for mobile added to URL address
-Means 2 sites to build, maintain, update and submit to search engines
-My New Responsive Website Design omits the need for separate mobile site.

*Single Site for all Devices: 1 site with 1 URL
MY NEW HTML5 + PURE CSS3 RESPONSIVE LIQUID LAYOUT w/ VERTICAL FLOW AND PURE CSS MULTI LEVEL RESPONSIVE DROPDOWN MENU
Using the new HTML5 with CSS3 media queries to build an automatic adjustable layout for all screen sizes and types of devices.
Pure CSS
-Means that the main functions of the website rely soley on CSS specifications.
-Website requires no JavaScript (or any other scrips) to function properly.
-The layout will stack, stretch and contract upon user font size alterations and screen zoom levels.
-The horizontal menu will drop down vertically on hover, keyboard, click or touch.
-Both the responsive layout and menu automatically conforms to all sizes of mobile devices.
Responsive
-Means it will adapt its size and content to fit any screen size (w/Mobile 1st Theory)
-Incorporating a responsive drop down navigation menu, for mobile specific menu
-No JavaScript. Instead use CSS3 Media Query
@media only screen and (min-width : 000px) {...the css...}
Liquid
-Means width will expand and grow upon any screen size change.
-Method: Using relative % and em unit of measure, VS absolute PX values
Vertical Flow
-Means all element groups have the same height and line up equally on the baseline
-Typography Method: Using the Golden Ratio 1.618 equations to calculate heights & widths
-Flow ratio results in a 16px default font with a 1.618em/26 unitless Line Height to use as the Magic Number Multiplier
Single URL Address
-Means no separate (m) mobile site, thus no Googlebot-Mobile SE web crawler
-WARNING: Googlebot may can recognize site as "Cloaked" if not configured correctly, which could cause SE to drop the site from search result completely. Relevant content MUST BE THE SAME thats served to both Googlebot and Googlebot-Mobile. Read in Google Webmasters SEO PDF Guide.
5) LINKING TO AND FROM OTHER WEBSITES:
The more other sites link to your site, the greater the visibility for crawlers in search results. Each website's reputation is passed to one another by any links to and from other each others websites.
Add link to your site to other reputable sites
-Submit or try to add your site to BBB, PhoneBooks, Chambers, Any Local Sites as well any national and global sites with related products or services.
-Maybe even social sites like blogs (esp Google Blogger I would think), facebook, G+, twitter etc. plus sharing would spread the links around globally
Other website links posted on your site: Works Both Ways
-Bad sites: like spammers who put a link on your site like in a public user comment will pass along their bad reputation to your site.
-Use Captcha's, add restrictions or other measures.
-apply to specific link:
<a href="http://www.shadyseo.com" rel="nofollow">Comment spammer</a>
-apply to all links on entire page
<meta name="robots" content="nofollow">
-Good Sites: pass along their good reputation
-Using individual photo hosting sites for images VS on the server itself would also apply more valid linking.
-Create a "LINK PAGE" and add any and websites that could be related in any way to your website, as well as information about the physical location area.

6) CONTENT: 
-Write information rich, quality content on home page vs Keyword List.
-Google may determine a list of keywords or cloaked page deceptive and ignore the site entirely.
-This may be keywords listed in html, as it refereed to text that users cannot see?

7) NAVIGATION:
-Besides user's ability to navigate through the sites pages, it also helps SE's know what is important. Although it doesn't return the navigational values, it still help the engine see the big picture of the sites structure and contents.
-See the Website Linking section above to add a new page or menu link


-Webmaster Guide states that 100% nav via dropmenu should be avoided. Hmmmm?
-My Opinion: I am assuming this is in regards to screen readers and devices that don't use or allow scripts. I would think my new responsive design would be OK since my responsive dropmenu doesn't rely on JavaScript to function, it is Pure CSS. The only issue would be people that HAS NOT updated browsers AND doesn't support the new media querries AND doesn't allow scripts.
-IMO adding alternative nav links would be a backup if the main drop down multi level menu may not be accessible. Alternative Methods could be a Breadcrumb Trail under header and/or a Site Map Page link in the Footer.






Thursday, September 4, 2014

Web Designer Resource List

Resource List 
For Web Designer


Table of Contents
* Main Web Design Elements
* Browser Support
* HTML5, CSS3, JS
* Styling Charts & Values

MAIN WEB DESIGN ELEMENTS

Desktop Program-HTML/CSS Editor: Notepad++
DreamWeaver Basic Alternative: Open Source. No Fee. No Trial. No Demo.
Developer Site: http://notepad-plus-plus.org/
cNet: http://download.cnet.com/Notepad/3000-2352_4-10327521.html
List of Best Editors

Desktop Program-Graphic Manipulation: Gimp2.8
PhotoShop Alternative: Open Source. No Fee. No Trial. No Demo.
Developer Site: http://www.gimp.org/
   -Plug In's
   -Help Documentation
   -User Manual Download
cNet: http://download.cnet.com/GIMP/3000-2192_4-10073935.html

HTML Markup Code Validator: W3C
http://validator.w3.org/

CSS Code Validator: W3C
http://jigsaw.w3.org/css-validator/

HTML WYSIWYG Editor: W3schools
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_style



BROWSER SUPPORT

CSS3 Browser Support Reference Chart
http://www.w3schools.com/cssref/css3_browsersupport.asp

Browser Type Usage Yearly Statistics and Trends Chart
http://www.w3schools.com/browsers/browsers_stats.asp



HTML, CSS, JS REFERENCE

HTML5 Reference
http://www.w3schools.com/html/html5_intro.asp
New Elements: http://www.w3schools.com/html/html5_new_elements.asp
New Page Semantics: http://www.w3schools.com/html/html5_semantic_elements.asp

CSS3 Reference
http://www.w3schools.com/cssref/

CSS3 Selectors Quick Chart 
(~ + > ::before,  first child, last of type hover target focus)
http://www.w3schools.com/cssref/css_selectors.asp

JavaScript Reference
Full Tutorial: http://www.w3schools.com/js/default.asp




STYLING CHARTS & VALUES

Color Names & HEX Value Chart
http://www.w3schools.com/cssref/css_colorsfull.asp

Standard Web Safe Fonts-Viewable Examples
http://cssfontstack.com/

Linked Web Fonts: 
Google Web Fonts-Viewable Expamples & Link Codes
https://www.google.com/fonts
-Google Fonts are powered by the Google Fonts API
-Choose from, list, add to your collection, choose size
-HTML code given:
<link href='http://fonts.googleapis.com/css?family=Rock+Salt' rel='stylesheet' type='text/css'>
-CSS code given:
font-family: 'Rock Salt', cursive;
Online Code Generator (prob HTML4?)
http://www.html.am/html-editors/online-html-editor.cfm


Domain Hosting & Name Registration


**********************************
Current Domain Parking Only:

My Domain Name: www.ozarkmountainsonline.com:
Who Is....http://who.is/whois/ozarkmountainsonline.com
History.....http://who.is/domain-history/ozarkmountainsonline.com
Registrar Info September 04, 2014
Name: TUCOWS DOMAINS INC.
Whois Server: whois.tucows.com
Referral URL: http://domainhelp.opensrs.net
Status: OK
Important Dates:
Registered On: October 31, 2005 (Hostica)
Updated On: October 31, 2011 (Cirtex)
Expires On: October 31, 2016

Name Servers:
ns7.cirtexhosting.com 108.165.20.118
ns8.cirtexhosting.com 50.22.172.19

Website
http://www.cirtexhosting.com/


Past domain parking & hosting

Hostica
http://www.hostica.com/
Registered On October 31, 2005
Updated On October 27, 2009
Expires On October 31, 2011
Name Servers:
ns1.hostica.com 208.43.98.100
ns2.hostica.com 50.23.212.113
ns3.hostica.com 67.228.114.233

****************************************

Top Hosting Companies: Consumer Rankings Top 10

1&1
https://www.1and1.com/web-hosting?linkId=hd.mainnav.hosting#top

Powerful Unlimited Space with the performance you need with the ability to expand as you grow.Hosting without limits. Affordable, reliable hosting without limits for endless potential. 

*Price: $0.99 mo
*Free domain for the life of your package…not just the first year
*Daily Backups Including Webspace Recovery in case you need it
*Daily Backups Including Webspace Recovery in case you need it
*Unlimited Webspace Endless space for your growing business
*Unlimited Websites One place for all your web projects
*Unlimited Bandwidth. RELIABLE Always on, Secure.
*Hundreds of AppsEasy and fast installations of open source apps and widgets, with security updates available
*Easy 1-Click Install, Intuitive Control Panel.

1&1 Unlimited Plan includes 1 domain or transfer or DNS point to new 1&1

Web Design: JavaScript

JavaScript
Explained


NOTE: TUTORIAL NOTES NOT COMPLETE

Source: 
http://www.w3schools.com/js/default.asp

Table of Contents:
* Highlights
* JS Functions
  -getElementById
  -document.write
* Script Tag
* Body or Head Placement
* External JS Files


HIGHLIGHTS

3 languages all web developers MUST learn:
1) HTML to define the content of web pages
2) CSS to specify the layout of web pages
3) JavaScript to program the behavior of web pages

HTML5 SCRIPT TYPE DEPRECIATED:
*Old examples may have type="text/javascript" in the <script> tag. This is no longer required. *JavaScript is the default scripting language in all modern browsers and in HTML5.

Body Placement for faster page load: 
*It is a good idea to place scripts at the bottom of the <body> element vs in the <head>.
*This improves page load, because HTML loading is not blocked by scripts loading.

External Scripts:
*External scripts cannot contain <script> tags.
*You can place an external script reference in <head> or <body> as you like.
*To use an external script, put the name of the script file in the source (src) attribute of the <script> tag:

No Print Functions:
*JavaScript does not have any print or output functions.
*In HTML, JavaScript can only be used to manipulate HTML elements.

JvaScript Functions & Events:
*Often, JavaScript code is written to be executed when an event occurs, like when the user clicks a button.
*JavaScript code inside a function, can be invoked later, when an event occurs.
*Invoke a function = Call upon a function (ask for the code in the function to be executed).


JavaScript Functions

JavaScript Can Change HTML Elements
-The HTML DOM (the Document Object Model) is the official W3C standard for accessing HTML elements.
-JavaScript can manipulate the DOM (change HTML contents).
-The method document.getElementById() is one of many methods in the HTML DOM.
-The following example changes the content (innerHTML) of an HTML element identified with id="demo":

document.getElementById("demo").innerHTML = "Hello JavaScript";

You can use JavaScript to:
-Change HTML elements
-Delete HTML elements
-Create new HTML elements
-Copy and clone HTML elements
-And much more ...

JavaScript Can Change HTML Attributes
-Change the value of the source attribute (src) of an HTML <image> element
-JavaScript Can Change HTML Styles (CSS)
document.getElementById("demo").style.fontSize = "25px";
-JavaScript Can Validate Data


Manipulating HTML Elements-getElementById
*To access an HTML element from JavaScript, you can use the document.getElementById(id) method.
*The JavaScript statement (inside the <script> tag) is executed by the web browser:
-document.getElementById("demo") is JavaScript code for finding an HTML element using the id attribute.
-innerHTML = "Paragraph changed." is JavaScript code for changing an element's HTML content (innerHTML).
*Use the "id" attribute to identify the HTML element, and innerHTML to refer to the element content:
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p id="demo">My First Paragraph</p>
<script>
document.getElementById("demo").innerHTML = "Paragraph changed.";
</script>
</body>
</html>
Writing to The HTML Document-document.write
*For testing purposes, you can use JavaScript to write directly to the HTML document.
*Warning: use document.write for testing only. If you execute it, on a loaded HTML document, all HTML elements will be overwritten.
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script>
document.write(Date());
</script>
</body>
</html>
The <script> Tag

*To insert a JavaScript into an HTML page, use the <script> tag.
*The <script> and </script> tells where the JavaScript starts and ends.
*The lines between <script> and </script> contain the JavaScript code:
<script>
function myFunction() {
    document.getElementById("demo").innerHTML = "My First JavaScript Function";
}
</script>

JavaScript in <head> or <body>

*You can place any number of scripts in an HTML document.
*Scripts can be placed in the <body> or in the <head> section of HTML, and/or in both.
*Often you will see scripts at the bottom of the <body> section of a web page. This can reduce display time.
*Sometimes you will see all JavaScript functions in the <head> section.
*Anyway, separating HTML and JavaScript, by putting all the code in one place, is always a good habit.

JavaScript in <head>
In this example, a JavaScript function is placed in the <head> section of an HTML page.
The function is invoked (called) when a button is clicked:
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
    document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</head>
<body>
<h1>My Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
</body>
</html>
JavaScript in <body> 
In this example, a JavaScript function is placed in the <body> section of an HTML page.
The function is invoked (called) when a button is clicked:
<!DOCTYPE html>
<html>
<body>
<h1>My Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
   document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</body>
</html>


External JavaScripts

*Scripts can also be placed in external files.
*External scripts are practical when the same code is used in many different web pages.
*JavaScript files have the file extension .js.
*You can place an external script reference in <head> or <body> as you like.
*The script will behave as if it was located exactly where you put the reference in the HTML document.
*Note: External scripts cannot contain <script> tags.
*To use an external script, put the name of the script file in the source (src) attribute of the <script> tag:
<!DOCTYPE html>
<html>
<body>
<script src="myScript.js"></script>
</body>
</html>

--------------

STOPPED AT JavaScript Syntax Tutorial

------------------

JAVASCRIPT HTML PLACEMENT - Forum Reading
If you have JS code which is intended to run as part of loading/building the page, where in the HTML should this go?

-Just before the closing </body> tag is emerging as the best practice barring a specific requirement for it to be elsewhere (which there can sometimes be). It's the recommendation of the YUI folks, for instance, but it's not just them.

What order do things happen in - the order they are in the page or does HTML all happen before (non-) JS is run?

-When a script tag is encountered, unless you use the defer or async attribute (and the browser supports them), all HTML parsing comes to a screeching halt and the script is downloaded and handed to the JavaScript interpreter. When the JavaScript interpreter finishes processing the script, the HTML parser can continue. It has to do this because the JavaScript can insert tokens into the HTML stream via document.write. This is also why you can load a script file and then load a second script file that relies on the first, and know that they'll get loaded in the right order. It's also why you can't access elements that are further down in the HTML stream from a script higher up in it unless you defer your code somehow (window.onload or the "DOM loaded" events many libraries support, such as jQuery's ready or Prototype's dom:loaded).

An upshot of this is that the typical practice of putting script tags in the head actually slows down the apparent load time of the page, unless those script tags need to be there for some reason. Hence the recommendation to put them just before the closing </body> tag.

There's a "gotcha" you have to watch for, though: If you have parts of the page that you want to respond to with JavaScript if the user has it enabled, loading your script at the very end leaves a brief but real race condition lying around: The user can interact with the page while your script is being downloaded. There are a variety of ways of handling that. My favorite is to detect whether JavaScript is enabled with inline script (not a separate file) in the head element and, if so, to put in a document-level handler for things where possible (you can do this with click events, for instance) which basically queues up or disables the click during that very brief period of time. That way, if JavaScript is enabled, you'll avoid the race condition, but if it isn't, any unobtrusive fallback you have in place will work.

Wednesday, September 3, 2014

Web Design: Server Side Scripts

Server Side Scripts
PHP, JavaScript, Pearl, ASP and TLS/SSL

Server Side Scripts and Secured Layers - Explained: 
Descriptions copied from : http://en.wikipedia.org/wiki/Server-side_scripting

Server-side scripting is a technique used in website design which involves embedding scripts in an HTML source code which results in a user's (client's) request to the server website being handled by a script running on the server-side before the server responds to the client's request. Scripts can be written in any of a number of server-side scripting languages that are available

Server-side scripting differs from client-side scripting where embedded scripts, such as JavaScript, are run client-side in a web browser. Server-side scripting is usually used to provide an interface for the client and to limit client access to proprietary databases or other data sources. Server-side scripting also enables the website owner to reduce user access to the source code of server-side scripts which may be proprietary and valuable in itself. The down-side to the use of server-side scripting is that the server website computer needs to provide most of the computing resources before sending a page to the client computer for display via its web browser.

When the server serves data in a commonly used manner, for example according to the HTTP or FTP protocols, users may have their choice of a number of client programs (most modern web browsers can request and receive data using both of those protocols). In the case of more specialized applications, programmers may write their own server, client, and communications protocol, that can only be used with one another.

Programs that run on a user's local computer without ever sending or receiving data over a network are not considered clients, and so the operations of such programs would not be considered client-side operations.

In the earlier days of the web, server-side scripting was almost exclusively performed by using a combination of C programs, Perl scripts, and shell scripts using the Common Gateway Interface (CGI). Those scripts were executed by the operating system, and the results were served back by the web server. Many modern web servers can directly execute on-line scripting languages such as ASP and PHP either by the web server itself or via extension modules (e.g. mod_perl or mod_php) to the web server. For example, WebDNA includes its own embedded database system. Either form of scripting (i.e., CGI or direct execution) can be used to build up complex multi-page sites, but direct execution usually results in less overhead because of the lower number of calls to external interpreters.

Script Languages:
There are a number of server-side scripting languages available, including:

ASP (*.asp)
ActiveVFP (*.avfp)
ASP.NET (*.aspx)
C (*.c, *.csp) via CGI
ColdFusion Markup Language (*.cfm)
Groovy Server Pages (*.gsp)
Java (*.jsp) via JavaServer Pages
JavaScript using Server-side JavaScript (*.ssjs, *.js) (example: Node.js)
Lua (*.lp *.op *.lua)
Perl CGI (*.cgi, *.ipl, *.pl)
PHP (*.php)
R (*.rhtml) - (example: rApache)
Python (*.py) (examples: Pyramid, Flask, Django)
Ruby (*.rb, *.rbw) (example: Ruby on Rails)
SMX (*.smx)
Lasso (*.lasso)
Tcl (*.tcl)
WebDNA (*.dna,*.tpl)
Progress WebSpeed (*.r,*.w)

Secure Network Programming API: TLS/SSL
Transport Layer Security (TLS) and its predecessor, Secure Sockets Layer (SSL), are cryptographic protocols designed to provide communication security over the Internet. A prominent use of TLS is for securing World Wide Web traffic between the website and the browser carried by HTTP to form HTTPS. Notable applications are electronic commerce and asset management.

They use X.509 certificates and hence asymmetric cryptography to authenticate the counterparty with whom they are communicating, and to exchange a symmetric key. This session key is then used to encrypt data flowing between the parties. This allows for data/message confidentiality, and message authentication codes for message integrity and as a by-product, message authentication. Several versions of the protocols are in widespread use in applications such as web browsing, electronic mail, Internet faxing, instant messaging, and voice-over-IP (VoIP). An important property in this context is forward secrecy, so the short-term session key cannot be derived from the long-term asymmetric secret key.

Web Design: Email

All things involving website email

Table of Contents:
*mailto: Links
*Hiding email address
   -CAPTCHA
   -Browser Encoding
   -Javascript & Php
   -CSS Pseudo-Classes

mailto: Links

Regular mailto: links
Spaces between words should be replaced by %20 to ensure that the browser will display the text properly.


Hiding email address from spam bots
Either don’t put it on the web page or take the necessary precautions. 

Source:
http://www.labnol.org/internet/hide-email-address-web-pages/28364/
http://www.w3schools.com/php/php_secure_mail.asp

CAPTCHA
Google’s reCAPTCHA service. It hide your email address behind a CAPTCHA image that requires user interface.

Browser Encoded Address
You can also encode email addresses in the browser. The encoded html mailto: address shows up on the client side as actual email address and copies accordingly.

*online encoder: http://ctrlq.org/encode/
-Just type the email address you want to encode.
-Copy the code we provide.
-Paste the code where the address should be.

my encoded yahoo email: &#107;&#97;&#121;&#97;&#107;&#99;&#104;&#105;&#99;&#52;&#51;&#50;&#64;&#121;&#97;&#104;&#111;&#111;&#46;&#99;&#111;&#109;

Insert html a:link:
<a href="mailto:&#107;&#97;&#121;&#97;&#107;&#99;&#104;&#105;&#99;&#52;&#51;&#50;&#64;&#121;&#97;&#104;&#111;&#111;&#46;&#99;&#111;&#109;
" target="_top">
Send Mail</a>


Hide Email through CSS pseudo-classes

UnSelectable:
You can use the ::before and ::after pseudo-elements in CSS to insert the email username and domain name on either sides of the @ symbol. The bots, which are generally blind to CSS, will only see the @ sign while browsers will render the complete email address which, in this case, is john@gmail.com. The downside with the above approach is that users won’t be able to select and copy your email address on the web page, they’ll have to write it down manually.

<style>
  my-email::after {
    content: attr(data-domain);
  }
  my-email::before {
    content: attr(data-user) "\0040";
  }
</style>

<!-- Set data-user and data-domain as your
       email username and domain respectively -->

<my-email data-user="john" data-domain="gmail.com"></my-email>


Selectable:
If you would prefer to use pseudo-elements but with a more user-friendly style that allows selection, you can try an alternate approach with all the email characters but the “@” symbol are selectable.

<style>
  .domain::before {
    content: "\0040";    /* Unicode character for @ symbol */
  }
</style>

john<span class="domain">abc.com</span>


Javascript

Obfuscate Email through JavaScript using the ‘onclick’ event. You can create a regular mailto hyperlink for your email address but replace some of the characters – like the dot and the @ sign – with text. Then add an onclick event to this hyperlink that will substitute the text with the actual symbols.

<a href = "mailto:johnATgmailDOTcom"
   onclick = "this.href=this.href
              .replace(/AT/,'&#64;')
              .replace(/DOT/,'&#46;')"
>Contact Me</a>


Random Array

Split your email address into multiple parts and create an array in JavaScript out of these parts. Next join these parts in the correct order and use the .innerHTML property to add the email address to the web page.

<span id="email"></span>

<script>
  var parts = ["john", "abc", "com", "&#46;", "&#64;"];
  var email = parts[0] + parts[4] + parts[1] + parts[3] + parts[2];
  document.getElementById("email").innerHTML=email;
</script>


WordPress + PHP

If you are on WordPress, you can also consider using the built-in antispambot() function to encode your email address. The function will encode the characters in your address to their HTML character entity (the letter a becomes &#97; and the @ symbol becomes &#64;) though they will render correctly in the browser.

<?php echo antispambot("john@abc.com"); ?>


PHP Secure E-mails

PHP Stopping E-mail Injections: The best way to stop e-mail injections is to validate the input. The code below is the same as in the previous chapter, but now we have added an input validator that checks the "from" field in the form.  Code uses PHP filters to validate input:
-The FILTER_SANITIZE_EMAIL filter removes all illegal e-mail characters from a string
-The FILTER_VALIDATE_EMAIL filter validates value as an e-mail address

<html>
<body>
<?php
function spamcheck($field) {
  // Sanitize e-mail address
  $field=filter_var($field, FILTER_SANITIZE_EMAIL);
  // Validate e-mail address
  if(filter_var($field, FILTER_VALIDATE_EMAIL)) {
    return TRUE;
  } else {
    return FALSE;
  }
}
?>

<h2>Feedback Form</h2>
<?php
// display form if user has not clicked submit
if (!isset($_POST["submit"])) {
  ?>
  <form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
  From: <input type="text" name="from"><br>
  Subject: <input type="text" name="subject"><br>
  Message: <textarea rows="10" cols="40" name="message"></textarea><br>
  <input type="submit" name="submit" value="Submit Feedback">
  </form>
  <?php
} else {  // the user has submitted the form
  // Check if the "from" input field is filled out
  if (isset($_POST["from"])) {
    // Check if "from" email address is valid
    $mailcheck = spamcheck($_POST["from"]);
    if ($mailcheck==FALSE) {
      echo "Invalid input";
    } else {
      $from = $_POST["from"]; // sender
      $subject = $_POST["subject"];
      $message = $_POST["message"];
      // message lines should not exceed 70 characters (PHP rule), so wrap it
      $message = wordwrap($message, 70);
      // send mail
      mail("webmaster@example.com",$subject,$message,"From: $from\n");
      echo "Thank you for sending us feedback";
    }
  }
}
?>
</body>
</html>