Announcement

Collapse
No announcement yet.

Checking if Javascript is disabled, noscript not working with basket custom field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Checking if Javascript is disabled, noscript not working with basket custom field

    In the footer on OCST, I have the following:

    <noscript>
    <mvt:item name="customfields" param="Write_Basket( 'noScriptCheck', 'No Script' )" />
    </noscript>
    On the header of OSEL, I have this:

    <mvt:item name="customfields" param="Read_Basket( 'noScriptCheck', g.noScriptCheck )" />
    &mvt:global:noScriptCheck;
    I disabled javascript on my browser, and saw No Script at the top of OSEL like I had hoped, but its showing up when I re-enable javascript as well. I've cleared out the browser data and tried again, but same result. I'm hoping to write it to a custom order field, so I can make sure someone has javascript enabled if theres an issue with their order. (I use javascript to add on other products to the basket).

    Any ideas?

    #2
    The noscript tags are processed in the browser, after the page has been generated and sent to the shopper. But the mvt:item is processed by the server while it's generating the page, before it sends the page to the browser. At that time, the server doesn't "know" whether or not the user's browser has JS enabled. So it ignores the noscript, and always renders the mvt:item tag.

    If you want to save the status of the users' browser, you'll need to put some code inside the noscript tags that can send a message to the store, possibly using a hidden form field on OCST that can be detected by code on OSEL.
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      Perfect! Thanks

      Comment

      Working...
      X