So, finally you did it.

There is still a problem when trying to separate the JavaScript code from the HTML template, though. The JavaScript code contains markers that are not replaced by the actual code if they are not in the main template file. Also parsing linked JavaScript files would solve the problem.
I'm trying to rewrite the HTML templates to the XHTML 1.1 specification using valid code, but there's one thing I cannot fix in the template: The plugin dynamically inserts
checked (for checkboxes) and
selected (for drop-down menu options) into the code. XHTML disallows this. Instead
checked="checked" and
selected="selected" has to be used to produce valid code. What speaks against using XHTML for the templates in general?
If you are willing to convert the templates to valid XHTML, here are some hints to solve issues that break the application in XHTML mode:
1. JavaScript code should be enclosed this way:
QUOTE
//<![CDATA[
...
//]]>
2. The
form element must not contain the attributes
name and
target. Remove the latter altogether and replace the former by
id and use
document.getElementById('cmd_form') instead of
document.cmd_form.
3. The CSS styles
width,
height and
left need to have units specified (like
px), otherwise they are not applied if the document is treated as XHTML. Simply adding
+"px" to the corresponding JavaScript statements solves the problem:
QUOTE
document.getElementById('np').style.width=Math.floor(np_width * t_sec / t_length)+"px";
QUOTE
height=getElementById("np").offsetHeight*2-2+"px";
left=getElementById("npd").offsetLeft+"px";
4. Write all HTML event handlers small (
onload instead of
onLoad for example).
Edit: I just finished my XHTML 1.1 compliant (and working) versions of the templates. You might want to take a look:
foo_httpcontrol_data.zipEdit (2): The server sends a charset called
utf8. I think it has to be
utf-8 instead. The XHTML validator complains that there's a charset mismatch.