Here's a simple JS function that will cause the rendering engine swallow it's own tongue and spit a nasty error message:
<script>
function doSomething(items) {
if(items.length > 0 && items.length < 5)
return;
}
</script>
First of all the < and > are not valid characters in XML so they are not valid in Facelets as well. And if you substitute them by < it will be rendered as < which makes the usage of < character impossible.
The same situation is with > sign as well as with && operator.
Of course you might say that my doSomething function makes no sense - it's for educational purposes only!
May the spirits protect us from Facelets!
Actually there's a preatty simple way of dealling with JSF reading what it shouldn't...
ReplyDeleteComment it out using html (stragelly your blog says my html is server side????)
Almost pulled my hairs out figuring that out
Ohhh by the way... Love some of the things you're talking about... Noticed some of those thing that make you say out loud WTF.
ReplyDeleteHope you don't mind me beeing the devils advocat... After all It's talking about things that makes us evolve
You can use CDATA to be able to use < , > and & in Javascript and Facelets... no problem
ReplyDeletetook me four hours too
ReplyDeleteWTF WTF WTFFFFFFFF!!!
hey I am using CDATA as well, and while the > < work many other js functions dont! This is so frustrating!
ReplyDeleteOh and I am confused to where I use ' or ":
document.createElement('button'); or
document.createElement("button"); ??
http://www.codehouse.com/javascript/tips/xhtml/
ReplyDelete