Hi,
I am displaying html from transformed content.
*module namespace **jq* = " http://www.architextus.com/xquery/library/how2_jquery"; *declare namespace **rest*="http://exquery.org/ns/restxq";
*declare* %rest:path("/testjquery") %rest:GET *function* *jq:test*() *as **node*(){
*let **$html* := <html *xmlns*=*"http://www.w3.org/1999/xhtml%22*%3E <head> <title>Testing JQuery</title> <script *src*=*"http://code.jquery.com/jquery-latest.js%22* *type*=* "text/javascript"*></script> </head> <body> <div> <p><input *id*=*"helpful-yes4"* *name*=*"helpful"* *type*=*"radio"*
</input><span>Yes</span>
<input *id*=*"helpful-no4"* *name*=*"helpful"* *type*=*"radio"*
</input><span>No</span></p>
<p>Here is a paragraph</p> <div *id*=*"t1"*>Test redirectire.</div> <script *type*=*"text/javascript"*>
$("#helpful-no4").click(function ( event ) { $("#t1").show();});
$("#helpful-yes4").click(function ( event ) { $("#t1").hide();});
</script> </div> </body> </html>
*return **$html* };
I access content with: http://localhost:8984/restxq/testjquery
The jquery does not work. If I save the result with a right-click in the browser, it saves as .xml. Jquery doesn't work either. If I rename the saved file .html. It works. Is there anything I can do for the browser to think what it gets is .html when displaying dynamic content?
Note: My html is not as simple as the one above. It is generated from an .xsl that actually says <xsl:output method="html"/>. The result however is the same.