Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / ASP

Writing ASP Chat using JavaScript and XML (Part 1)

Rate me:
Please Sign up or sign in to vote.
4.15/5 (14 votes)
21 Jan 20045 min read 91.1K   2.4K   50  
Step-by-step article about writing web-based chat. This article explains the simplest chat.
// IncorrectInputFilter class
function IncorrectInputFilter() {
	this.processText = IncorrectInputFilter_processText;
	this.getPattern = IncorrectInputFilter_getPattern;
}

function IncorrectInputFilter_processText(inputText) {
	var s = new String(inputText);
	return s.replace(this.getPattern(), "...");
}

/**
 *  Provides regular expression pattern with bad words
 */
function IncorrectInputFilter_getPattern() {
	var re = /fuck|shit|asshole|nigger|idiot|cunt|kunt|arse|kaffir|honky|wetback|suka|xyu|bljat|pizda/gi;
	return re;
}
// IncorrectInputFilter class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Ukraine Ukraine
Alexander Fedorenko is a professional C++ developer since 1996. He completed many custom and shareware projects. One of the successful projects is DevPlanner - tool for personal planning and time management.

Comments and Discussions