Creative Juices Bo. Co.

Satisfy Your Thirst For Something Refreshing!

CJ Parse Tools 3.0.1

A Collection of jQuery String Parsing Functions

Project Description

CJ Parse Tools is a jQuery plug-in that contains a collection of various parsing functions to help you convert strings to various formats. Tools include converting HTML markup and Latin 1 entities to Ascii, converting a string to valid XML Latin 1 entities and converting ASCII back to HTML & XML entities. Essentially if you need to convert something like & to &, then this JQuery plugin is for you.

toAscii

Converts HTML markup and Latin 1 entities to Ascii.

Usage

jQuery(object).toAscii({clean:true|false});

Example*

var str  = ""toAscii is über cool!"";
var nstr = jQuery(str).toAscii().get(0);

...and the result...

"toAscii is über cool!"

*The function returns a jQuery object, hence the use of get(0)

Options
You can have the script clean the HTML code by passing a true value. This option will strip html tags, remove extra line breaks and remove any leading white space. Defaults to true

toHtml

Converts a string to valid HTML markup and Latin 1 entities.

Usage

String.toHtml();

Example*

var str  = '"toHtml is über cool!"';
var nstr = jQuery(str).toHtml().get(0);

...and the result...

"toHtml is über cool!"

*The function returns a jQuery object, hence the use of get(0)

toXml

Converts a string to valid XML Latin 1 entities.

Usage

String.toXml();

Example*

var str  = '"toXml is über cool!"';
var nstr = jQuery(str).toXml().get(0);

...and the result...

"toXml is Über cool!"

*The function returns a jQuery object, hence the use of get(0)

Conclusion

The functions within this collection are not something you are going to use everyday, but for those times you do, they're great. If you have any problems or need help, let me know.