About Chert

parentingrock.com

PHP: substr

substr(string $string, int $start [,int $length])

– $start is zero-based
– $length, for example if string is We only have…, it should print as ly have…. It begins on the 5th index.

===

strpos

– returns true

$mystring = ‘abc’;
$findme = ‘a’;
$pos = strpos($mystring, $findme);

===

$phrase = "Your love is like a river that flows...";
$string = 'love';
$len = strlen($string);

$pos = strpos($phrase, $string);

$show = substr($phrase, $pos, $len);

echo $show;

Code Academy

This is most correct:

var i = 0;
while (i < 5){
i++;
console.log("You're beautiful!");
}

You’re beautiful!
You’re beautiful!
You’re beautiful!
You’re beautiful!

Versus


var i = 0;
while (i < 5){
console.log("You're beautiful!");
i++;
}

You’re beautiful
You’re beautiful
You’re beautiful
You’re beautiful
You’re beautiful
5

JS

Finding elements by class name does not work in Internet Explorer 5,6,7, and 8.

document.getElementById(id).attribute=new value

document.getElementById(id).style.property=new style

y[0].innerHTML

getElementByID(“”)
getElementsByTagName(“”) —> with s

Email Newsletter Design

Using colored text against a colored background image is a perfectly acceptable practice when designing a website. In an email, however, you should assume that the background image will not load. If that happens, your pink text on a brown background image will turn into unreadable pink text on white or grey. Needless to say, an unreadable email is worthless.

Many designers attempt to circumvent the constraints of email layouts by designing a promotional email using only images. While this allows you to do very creative layouts, it also makes your email worthless if your images don’t load.

Your viewers are just going to get an email with a bunch of broken image links. Lots of your recipients are going to be viewing email from a cellphone or behind a company firewall or other content-filtering system that may block your images as well. So keep that in mind.

Also, putting a handy “Having Trouble Viewing This Email” link that takes the viewer to an actual webpage with your email content isn’t a bad idea either.

Many people don’t actually open their email but view it in the preview pane along the side of their inbox. This gives a very narrow space to work with if you don’t want to make someone scroll to see your entire layout.

Keeping your design at 600px wide or less is a good rule of thumb, but even then some email clients are going to only display a narrow portion of your email. Make sure you have your important text on the left side of the email toward the top. That part of the email is sure to be seen and will entice the viewer to either scroll or open your message in a full window

source: http://www.webdesignerdepot.com/2011/05/dos-and-donts-for-designing-email-newsletters/

Do extensive testing

For testing, make sure you set up accounts with all the major web-based email services like GmailGmail,
HotmailHotmail, and
Yahoo MailYahoo Mail as well as the common desktop email clients like Outlook,
Apple Mail, and Thunderbird as well as the mobile Android and iPhone mail apps.

(Hired. 2nd day in UWCSEA. Thank you Lord!)