Re: Detecting Javascript enabled (browser side)
Re: Detecting Javascript enabled (browser side)
- Subject: Re: Detecting Javascript enabled (browser side)
- From: Simon McLean <email@hidden>
- Date: Thu, 3 Sep 2009 15:12:37 +0100
Erxsession has a method which is something like "jsEnabled()" -I don't
have access to th docs so can't tell you what it is exactly
problem is it doesn't work - it's been broken for a while
good news is I submitted a patch for it. Bad news is o don't think
it's made or onto the core yet. But tou can surf through wonders Jira
and pick up the patch yoursel.
Sorry for crappy typing - attempting to use gmail on my iPhone :-(
Simon
On Monday, August 10, 2009, Mark Gowdy <email@hidden> wrote:
> 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 = "$clickedRemoveFromOrder" title = "Remove from basket" class = "remove" updateContainerID = "$mediaItem.pk.toString"> Remove </wo:AjaxUpdateLink>');</script>
> ---------------------------Generates:---------------------------<noscript> <a class="remove" title="Remove from basket" href="/cgi-bin/WebObjects/Shop.woa/wo/3.0.17.10.0.0.1.3.11.1.1.1.1.3.1.5.1.3.1"> Remove </a></noscript>
> <script type="text/javascript"> document.write('<a href="javascript:void(0);" onclick="AUL.update('246', {}, '3.0.17.10.0.0.1.3.11.1.1.1.1.3.1.5.1.3.3');" title="Remove from basket" class="remove"> Remove </a>');</script>---------------------------
> I believe I need to escape the following characters so that they can be inserted into the document.write as a parameter.' /and probably a few more?
> Is there a container I can use that will escape the generated HTML automatically?Or maybe an additional binding on AjaxUpdateLink (escapeForJavascript)?
> Other suggestions welcome.
> Thanks in advance,
> Mark
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden