Redirect to a Custom "JavaScript Required" Page

knightknightknightknight Member
in Help edited February 2009
Okay seems my <noscript><meta http-equiv="refresh" content="0; url=/[~56~]" ></noscript> works but sucks on w3 validation. ([~56~] is a MODx id URL)

So I've tried adding the better example from the FAQ: http://wiki.foxycart.com/faqs?s[]=required

Works like it should but what if I've got a cart?cart=view link. Each time I click it I get no response other then the fancy hour glass moment.

I've tried adding to the:
$j('epc_product').attr('action','https://example.foxycart.com/cart?cart=view');

but it didn't work. So I also tried adding:
var href_cart = href.replace('/[~56~]','https://the-energy-portal.foxycart.com/cart?cart=view');
but again didn't work for the cart?cart=view

Any suggestions?
Comments
  • Slightly off-centre of the topic. Found you can customise the no javascript message in Templates => Lanaguage
    Our checkout process requires javascript. Please <a href="http://www.foxycart.com/index.php?id=28"; target="_blank">click here to enable javascript</a>. You may then click the checkout button below, or refresh this page to make changes to your cart.
    But would rather have a detect on the products page before the user has even click, submit or cart?cart=view.
  • brettbrett FoxyCart Team
    $j('epc_product')
    Probably need something like $j('#epc_product') or $j('.epc_product'), no?
    var href_cart = href.replace('/[~56~]','https://the-energy-portal.foxycart.com/cart?cart=view');
    
    That won't work because javascript runs in the client, so by the time the js is running it's not seeing [~56~]. It's seeing index.php?id=56 or /my-doc-alias.html or whatnot.

    As far as validation goes, the noscript tag kind of sucks. You can't put anything inside it without getting validation errors, wich is really lame. You'll notice that the code we actually output for ^^cart^^ and ^^checkout^^ doesn't validate because of that, but in all honesty I find that stupid, so I'd rather have a harmless validation error (and it is pretty harmless in this case) than make things more difficult to the user. But that might just be me.
Sign In or Register to comment.