Hello,
We recently started using the Wonder Ajax framework (which is amazing btw, well done guys), but we want to be able to detect if _javascript_ is enabled on the client's browser.
I suspect this is a problem solved by many before, but I cannot seem to find a reliable solution.
I have considered setting cookies using client-side _javascript_, then checking for them server-side.
But conditions can arise where this might not work.
Checking client-side should be the simplest and more reliable way, but I have hit a little problem.
The <noscript> condition is simple (no issues there)
The <script> condition is less simple. You have to use a document.write('..');
The problem is now an escaping issue (as demonstrated below):
TheComponent.html
---------------------------
<noscript>
<webobject name = ClickedRemoveFromOrder> Remove </webobject>
</noscript>
<script type="text/_javascript_">
document.write('<wo:AjaxUpdateLink action = "" title = "Remove from basket" class = "remove" updateContainerID = "$mediaItem.pk.toString"> Remove </wo:AjaxUpdateLink>');
</script>
---------------------------
Generates:
---------------------------
<noscript>I believe I need to escape the following characters so that they can be inserted into the document.write as a parameter.
Is there a container I can use that will escape the generated HTML automatically?
Other suggestions welcome.