[Xsltforms-support] Keeping initial state of a form initialized by the server?
Brought to you by:
alain-couthures
From: Grégoire C. <gco...@gm...> - 2011-04-20 14:43:48
|
Hi Alain! As you know, Google and other search engines don't execute JavaScript. So if someone wants his XSLTForms with a specific state indexed by Google, he has to do everything (XSLT + JS) on the server, so that Google sees the correct HTML. This could be ideal : given that you have written some JS to initialize your form based on the URL, you could: 1) serve Google what he wants (correctly filled HTML); 2) keep XSLTForms code alive in the <head>, so that humans can still use the form. If you use Firefox Web Developer extension, you can use "View generated source" to retrieve the equivalent of a full server-side initialization. Save this view to a file, disable JavaScript, and open this file : this is what Google will see, and "so far so good". But if you don't disable JavaScript before opening this file (case #2, what normal users will do), XSLTForms doesn't keep the generated state. Test-case is attached: the source "test-wrong-order.xml" and the already initialized form "test-wrong-order-statique.html". An idea to avoid this problem could be that XSLTForms set a variable somewhere in the page that would tell him if the form is already initialized or not. It could then be possible to initialize everything on the server to satisfy search engines, and still serve a dynamic application to users. How does it sound? Thanks! Grégoire |