1. How to trim a string
2. How to use arrays
3. How to split a string
4. Uses an aspire function called getSelectedCheckBoxValues

Can I specify multiple classes on an html tag

Creating a function object from its string name

6) Example java script 1


How to include a javascript library
How to include a style sheet
A handful of javascript functions
//Returns a string value 
//of the url for the image of an anchor object
function getImageSrc(saveAnchor)
   //alert("Working with an anchor:" + saveAnchor.href);
   imgElement = saveAnchor.children[0];
   if (imgElement == null)
      //alert("Warning: this saveanchor does not have an image element");
      return null;
   //alert("An image anchor found");
   //alert("The source of the image is: " + imgElement.src);
   return imgElement.src;

8) Flash notes


A beginers quest for flash and what is possible

how can I change a mouse pointer?

how can i control the margin of a div's children

How do you implement inheritance in javascript?

Use document's capture events.

How to construct a local file url for chrome?

How to control ie with signed scripts

Description to be entered

how to disable an html link?


Some times when server side needs to write out a string variable that initializes a javascript string it is important to know how to escape strings.

The usual html escape and unescape are either too heavy handed and require probably special handling.

A good approach may be just use the back slashes to skip the quote double or single quotes.


How to figure out screen resolution in javascript


if ((screen.width>=1024) && (screen.height>=768))

This articles explores a couple of ways of hiding div sections in an html document. The discussion will apply to other html controls as well that exhibit "display" and "visibility" properties. The article also contains sample code.

How to initialize a javascript object

	function redirectTo()

<body onload="redirectTo()">

How to replace tabs with spaces

How to set body onload from javascript

We ran into a usecase where a user has to explicitly target a tab in ie. For example users have logged into salesforce.com cloud in one window. These users are then taking calls in that window. However same users are using another internet application to complete their work. It would be messy to open up these multiple windows every time work needs to be done.

It is probably better to target just one window and the user transferred to one window. Better yet to target a specific tab.

So started my search. I thought it ought to be simple. As it turned out there doesnt seem to be a good way to do this through regular unsigned javascript in ie7. I did find a way to do this in firefox.

ie seem to control tab vs new window purely through user configuration. Users can choose to set a global ie option to open new windows targeted by "_blank" to either an actual new window or a tab. Once they set this option as tab then the simple window.open(url) will open that url in a new tab.

I still want to force to open in a new tab. Perhas I will find a way through signed javascript. that is for another day or week.

If you are further curious what follows is my research and notes on how I came to this conclusion. Click on the item above to see that research.

27) How to use Firebug


How to use Firebug

28) How to write ie controls


How to write ie controls

29) html: HTML tag reference



Commonly used html tag reference

inner function in javascript

javascript and checksum

33) javascript and href


javascript and href

Javascript and name spaces

For mere mortals or the occasional or reluctant practitioner of Javascript this page documents some common errors. Needless to admit that I made all of them! More than once!

javascript function index of any one character from a string?

Conditional exectuion of functions




39) Javascript notes


Description to be entered

Javascript try, catch, and console

41) Javasscript versions


Javasscript versions


you will need to use the escape and unescape functions.

function getCursorPositionInTextField(textFieldObj) 
	//This is required if you were to be clicking on a button to invoke this
	//otherwise your selection is the button
	textrange = document.selection.createRange().duplicate();
	//You may have to make sure the selection and focus is with your object
	//because the selection is document level entity.
	//if (textrange.parentElement() != textFieldObj)
	//	alert("Sorry you are not the field");
	var i=0;
	while(textrange.move("character",1) == 1)
	return textFieldObj.value.length() - i;

How to parse a url using javascript

How to get a relative url from any url address

How to use a static html page to redirect to a different web address

46) js: sample html



<script type="text/javascript" src="/webapp/scripts/file.js"></script>

function test(field)

numeric field 1: 
<INPUT type="text" name="test1" size="20" onblur="test(this)">

numeric field 2: 
<INPUT type="text" name="test2" size="20">

Create an anchor with a name at the bottom

<a name="bottom"> </a>

Jumpt to it from anywhere

<p><a href="#bottom">Go to the bottom</a></p>


Introduction: Structure of Tutorial
Chapter 1: What is HTML anyway?
Chapter 2: Basic concepts
Chapter 3: Primary tags
Chapter 4: Creating your first Web page
Chapter 5: Basic text formatting
Chapter 6: Lists
Review #1
Chapter 7: Attributes: Adding interest to your page
Chapter 8: Advanced Text Formatting
Review #2
Chapter9: Links down the street to around... 
Chapter 10: Graphics
Chapter 11: Building pages with tables
Chapter 12 More on tables

line1 character1 invalid: a javascript error

52) log-in patterns


log-in patterns

54) Nature of Javascript


Nature of Javascript

55) New OO Javascript


New OO Javascript

57) Polymer



Read this article for engineering data base driven web sites.

59) React



60) Run tidy online



To see if your page is xthml. Also gives an xhtml version of output.

61) Sample javascript code


Description to be entered

Scoping of variables in Javascript

border-top:1px solid

div.footerDiv1 p
    margin:0 0 0 0;

<div class="footerDiv1">
<p>Test1 kddkkkd ddd
<p>Test1 kddkkkd ddd


1. time and date scripts
2. menu scripts
3. Javascript documentation links
4. A plug for dhtml

Consider this

function Pair(inMin, inMax)
    this.min = inMin;
    this.max = inMax;

Which would let me use

var somepair = new Pair(5,10);
somepair.min => 5
somepair.max => 10

See this function now

function getTotalScaledScorePair()
    var rpair = getReadingScaledScorePair();
    var wpair = getWritingScaledScorePair();
    var mpair = getMathScaledScorePair();
    var tmin = rpair.min + wpair.min + mpair.min;
    var tmax = rpair.max + wpair.max + mpair.max;
    return new Pair(tmin, tmax);

66) submitting http forms


submitting http forms

Tokenizing strings in javascript

68) Transparent text


Transparent text


<script language="JavaScript" type="text/JavaScript">
function setHTML(e) {
	if (e) {
	else {
		 .innerHTML=" ";

Understand javascript nulls

71) Understanding cookies


Revisit Understanding Cookies


Will the java url libraries deal with this correctly?

>> Tuesday, April 04, 2006 6:44:53 PM - Comments by satya

Codes that need to be handled

Handling redirects manually through java api

301 Moved Permanently. HttpStatus.SC_MOVED_PERMANENTLY 
302 Moved Temporarily. HttpStatus.SC_MOVED_TEMPORARILY 
303 See Other. HttpStatus.SC_SEE_OTHER 
307 Temporary Redirect. HttpStatus.SC_TEMPORARY_REDIRECT 


Where you find one, you find many

// createCookie
// Borrowed from the internet (Scott Andrew)
function createCookie(name,value,days)
   if (days)
      var date = new Date();
      var expires = "; expires="+date.toGMTString();
   else var expires = "";
   //document.cookie = name+"="+value+expires+"; path=/";
   document.cookie = name+"="+value+"; path=/";

// readCookie
// Borrowed from the internet
function readCookie(name)
   var nameEQ = name + "=";
   var ca = document.cookie.split(';');
   for(var i=0;i < ca.length;i++)
      var c = ca[i];
      while (c.charAt(0)==' ') c = c.substring(1,c.length);
      if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
   return null;

74) Web Components


Web Components

75) Web Security Constraints


Web Security Constraints

76) what are bookmarklets


what are bookmarklets

What html element generated the event?

78) What is HAML?


What is HAML?

whats up with coffee script?

Whats up with new UX components: 2017

81) working with Curl


working with Curl

Working with radio buttons