Created
June 11, 2014 11:36
-
-
Save amdgigabyte/891ec8f567b1030b79eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
width:500px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="KISSY XTemplate Test" /> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script src="http://g.tbcdn.cn/kissy/k/1.4.3/seed.js"></script> | |
</head> | |
<body> | |
<div class="input"> | |
~!@#$%^&*()_+{}/"test' | |
</div> | |
<div class="result"> | |
</div> | |
<p class="result2"> | |
</p> | |
<input type="text" class="test"> | |
<script> | |
KISSY.use('dom,xtemplate', function (S,DOM, XTemplate) { | |
var aa = '<h2><p>"</p></h2>'; | |
var tpl = '{{titlewithH2}} and {{{titlewithH2}}}'; | |
var tpl2 = '<input type="text" class="result3" value="{{titlewithH2}} and {{{titlewithH2}}}">'; | |
var data = { | |
titlewithH2: '~!@#$%^&*()_+{}/"test'', | |
}; | |
var render = new XTemplate(tpl).render(data); | |
DOM.get('.result').innerHTML = '<div>' + render + '</div>'; | |
DOM.get('.result2').innerHTML = '<div>' + new XTemplate(tpl2).render(data) + '</div>'; | |
DOM.val('.test',new XTemplate(tpl).render(data)); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment