Lin Wj wrote:
problem : i have to develope a app using ajax features and it has to run
in an environment(web tv related) which is very strict about XHTML
and ajax codes generated by rails doesnt seem to be compliant.
(they work on normal webpages , but not in the webtv env)
other than writing my own ajax codes and including them as helpers.
is there any other way ?
Each page needs a test case like this:
If you put "Strict XHTML" into your DOCTYPE, then tidy should enforce that.
Next, to test an Ajax call, you would do this:
xhr :get, :xhr_change_the_frob
assert_js_replace_html :frob do
assert_xpath :'form/input[ @name = "baz" and @value = "42" ]'
All these tests will fail if the XHTML has a single ill-formed tag.
At my day-job, we enforce strict "Transitional XHTML", even though we only target wildly forgiving browsers, and even though our production code could get away with sloppy HTML. We do this because enforcing XHTML makes all our view tests much easier to write.