Tweet



 
A very easy to use, cross platform, jQuery based UI toolkit, that’s still small in size, has the features you need, and doesn’t get in your way of doing things!

Hi, stranger

jKit is growing almost daily, if you don’t find what you need, let us know with a post on the community forum or our social pages. Hey, who knows, maybe it’s already on our ToDo list.

Content Summary

jKit Button

If you like jKit, use and want to support the project, here’s a small button you can use to link to the jKit website.

Btw, if you did something really nice with jKit, send us a link to your work and if we like it, we would sure love to feature it.

Encode command

A simple command to encode the content of an element, especially usefull for pre and code elements.

Basic Usage (HTML)

data-jkit="[encode:format=text]"

Advanced Init (JavaScript)

$('#myelement').jKit('encode', { 'format': 'text' });

Options

OptionValuesDefaultDescription
format“code”, “text”, “esc” or “uri”codeThe format used to encode the html
fix“yes” or “no”yesIf the code format is used, this option will indent the code without unneaded whitespace

Events

This command has no events.

Examples

Basic demos:

Demos of the four decoding types, “code”, “text”, “esc” and “url”:

<h2 id="command_encode">Encode</h2>
Encode
%0A%09%3Ch2%20id%3D%22command_encode%22%3EEncode%3C/h2%3E%0A
%0A%09%3Ch2%20id=%22command_encode%22%3EEncode%3C/h2%3E%0A
Source:
<pre data-jkit="[encode]"><h2 id="command_encode">Encode</h2></pre>
<div class="box" data-jkit="[encode:format=text]">
	<h2 id="command_encode">Encode</h2>
</div>
<div class="box" data-jkit="[encode:format=esc]">
	<h2 id="command_encode">Encode</h2>
</div>
<div class="box" data-jkit="[encode:format=uri]">
	<h2 id="command_encode">Encode</h2>
</div>

Advanced demo:

Here’s an example where we first use the text format and than we’re using an uppercase format that we added through jKits replacements feature (check the head source):

Encode
Source:
<div class="box" data-jkit="[encode:format=text][encode:format=uppercase]">
	<h2 id="command_encode">Encode</h2>
</div>

Replacements

There are currently no replacements for this command.

[ Learn more about replacements ]

 

Discussions

Do you have questions or do you want to suggest new features? Than head over to our new community:

[ jKit Community ]