Griffin Interactive

FormSIX - Form Simple Interface in XML

February 24, 2005

Scripting

FormSIX stands for Form Simple Interface in XML. It comprises of an XML parser writen entirely in JavaScript.

The purpose of FormSIX is the extend the Common Gateway Interface (CGI) by using XML as a transport mechanism where Client - Server communication is achieved using XML.


Get active with this UI toolkit

March 05, 2004

Scripting

I hope im wrong but I'm starting to think that most client-side developers have given up on common widget libraries, the inherent problem is the fact that supporting all flavour of browsers becomes so difficult and error prone that most development stops within the first few months.

Is it really the case that increase in bandwidth will be the death of the thin-client application? or is common client-side application delivery just before its time?

Anyway whatever your conclusion there is a new widget library called Active UI. It is a cross-browser Web GUI toolkit. This opensource project currently comprises of the following widgets, grid, tree, tabs, menu. It is built using DHTML, Javascript DOM, CSS and XML and can be integrated with any CGI page generation systems such as JSP, ASP, PHP and anything else that will generate the script at the Standard-Output level.

See also


Rasmus Lerdorf's PHP

March 04, 2004

Scripting

The creator of PHP Rasmus Lerdorf once mentioned at the Euro Apache conference in 2000 that he created PHP simply to make his life easier when developing web applications were he worked. I’m sure he didn’t envisage it would ever be quite as popular as it is today. His short article 'Do You PHP?' notes PHP's current usage, advice for architects and its future within the web development community.

He also mentions that it is all to easy to write messy code in Php :)


PHP and Large Websites

February 18, 2004

Scripting

Aaron Crane of gbdirect has written an article expressing his experiences of using PHP in large scale websites.

The article focuses on the well known fact that many php based sites are difficult to maintain due to the combined presentation with business logic. It also highlights the difficulty of using php in large group development projects and that the language that was created for its simplicity is offten more complex than most when using it to create large websites.


Reduce your Spam

February 10, 2004

Scripting

I’ve recently noticed that many websites have what looks like JavaScript ‘gobbledegook’ at the base of their pages. On further investigation I’ve come to discover that this is in fact a JavaScript function that encodes / obfuscates your html source.

This encoding is useful by helping to prevent nasty email harvesting robots from plucking out your email address from your websites mailto tag. (Which it would otherwise use for spamming purposes).

You could write your own encoder or use an online encoder; a popular encoder can be found at hiveware.com just type in your address hit the button and it will return you a piece of javascript that you can then cut n paste into your web page.

Other links:-


Regular Expressions

October 13, 2003

Misc

Here's a site I wish I would have found a while ago when I needed an expression for UK post codes. Its got a whole host of expressions ready to cut n paste :)


Remote Scripting

July 10, 2003

Scripting

Today web sites are trying to become more and more like traditional applications, however the call-response-reload model used in HTTP transactions makes this concept difficult and clumbersome to implement.

Applets (browser plug-ins) were created to allow the developer to build these more complex client-side applications, allowing connections directly to the server, for example in the infamous 'chat' applet. However these applets are seen to be rather 'heavy-weight' and more often than not look drab on website.

In modern browsers we can use DHTML to create dynamic content from the server without having to reload a page.

This 'remote scripting' concept is introduced on the Apple developer website.

- Remote Scripting with IFRAME - Apple
- Remote Scripting with IFRAME - O Reilly
- DotVoid - Remote Scripting with javascript
- DHTMLCentral - Remote Scripting with javascript
- Remote Scripting Resources


Managing multiple onLoad events in JavaScript

April 25, 2003

ScriptingIt is possible to add multiple function calls within the standard onload event within the body tag, however there comes a time when we may want to use the window.onload call within our webpages. This will clash with our onload calls already defined within the body tag. This article written by Robert Dominy, demonstrates the use of a separate script that adds each function to an array which will subsequently execute each onload function in turn. Without it we have no way to guarantee that all our required functions are called. onLoad event
Safe onLoad event

JavaScript Source

Copy the following and paste into the HEAD section of your page.

<script language="JavaScript">
// Browser Detection
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;

// Body onload utility (supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f)
{
	if (IEmac && IE4)  // IE 4.5 blows out on testing window.onload
	{
		window.onload = SafeOnload;
		gSafeOnload[gSafeOnload.length] = f;
	}
	else if  (window.onload)
	{
		if (window.onload != SafeOnload)
		{
			gSafeOnload[0] = window.onload;
			window.onload = SafeOnload;
		}		
		gSafeOnload[gSafeOnload.length] = f;
	}
	else
		window.onload = f;
}
function SafeOnload()
{
	for (var i=0;i<gSafeOnload.length;i++)
		gSafeOnload[i]();
}

// Call the following with your function as the argument
SafeAddOnload(yourfunctioname);


Using Exception handling in JavaScript 1.5

December 11, 2002

Scripting

JavaScript 1.5 (ECMA-262, revision 3) has a host of new functions including error handling this gives developers the ability to make their code more robust when coping with a wide range of unexpected events that could occur.

The try...catch...finally statement lets you safely respond to all types of exceptions. Errors are a type of exception thrown by the JavaScript interpreter when an anomaly such as an out-of-bounds array index, type mismatch, or syntax error occurs. The ECMAScript standard defines six types of errors. In addition, JavaScript 1.5 provides you with the capability to create and throw your own exceptions with the Error object and throw statement.

Read more at WebBuilder.com

try...catch...finally statement:


try {
// Statements in which exceptions might be thrown
} catch(error) {
// Statements that execute in the event of an exception
} finally {
// Statements that execute afterward either way
}


Java to Javascript Communication

August 31, 2002

Java

In this article we look at Netscape's LiveConnect which is used to allow JavaScript to Java and Java to JavaScript communication.

However in the light of Mozilla 1.0 it is also important to look at replacement technologies such as XPConnect.

Two other related articles from IBM and Sun are also worth a view, Revisiting Java technology on the client and How Java TO JavaScript
communication works in Java 'Plug-In'
.