javascript - How to make Resig's micro-templates XHTML compliant? -


I am using what works great, however, Mark-up XHTML 1.0 will not pass the transitional verification test. (In addition to other things, yield attributes of id attributes occur.)

Changing tag identifiers & lt ;,> [[,]] passes verification, thus, I have a JS script Created that change square brackets back to regular markers on load time (jQuery document ready). It works fine in FF, but not IE, Chrome etc.

The embedded scripts are also valid within the CDATA tag.

Q: Is there a way to insert a micro-template and still pass XHTML verification? I thought that after the page was loaded, the CDATA tag was to be removed. But perhaps there are smart ways (Note: I do not want to inject HTML through JSM because it will be difficult to maintain a mark-up.)

PS: I looked at other JS templates, but they either TIA is not compatible with XHTML or for any signal.

Why are you going from crisis to use a micro-template instead of using a micro-template? All the ways to change? All this seems like a waste of processing to load in a certain way, and then change it all, so it is compatible with the script.

Why not modify the original script to use [[ tag] instead of the original & lt;% tag ?

How it recognizes templates

  str .replace (/ [\ r \ t \ n] / g, "") .split ("& lt; % "). Join ("\ t". () (^ (^ |% & Gt;) [^ \ t] *) '/ g,' $ 1 \ r ") .replace (/ \ t = (. *?) % & Gt; / g, "', $ 1,'") .split ("\ t"). Include ("'); Join "(" P. Push ('") .split (" \ r ") .joint (" \\' "+ '' ');} Return P. Join (''); ");  

Now replace with [[ and & gt;% From ]]

  str .replace (/ [\ r \ t \ n] / g, "") .split ("[[".) Join ("\ T") .replace (/ (^ (^ |]] [^ [t] *) '/ g,' $ 1 \ r ") .replace (/ \ t = (. *?)]] / G, "', $ 1,' ') .split (" \ t "). Include ("'); ") .split ("]] "). (" P. Push "(" "). Split ("\ r"). "\\ '") + "');} return p.join ('');");  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -