We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29089
    • 13 Posts
    Hey everyone, I’m sure this is a relative simple problem (because I think i read about this somewhere a while ago, but cant find that resource anymore).

    I’m including the following JS in a TV:
    <script type="text/javascript"> 
    	$(function() {
    		$("#warehouse-list")
    			.tablesorter({sortList:[[2,0]], widthFixed: true, widgets: ['zebra']})
    			.tablesorterPager({container: $("#pager")});
    	});
    </script> 

    Which when rendered on the front-end spits out:
    <script type="text/javascript"> 
    	$(function() {
    		$("#warehouse-list")
    			.tablesorter({sortList:, widthFixed: true, widgets: ['zebra']})
    			.tablesorterPager({container: $("#pager")});
    	});
    </script> 

    Obviously modx is interpreting this as some sort of variable: "[[2,0]]".

    So obvious question is, how can i get this to render without being interpreted the wrong way my modx.

    Thanks in advance fellas.
      • 36416
      • 589 Posts
      Quote from: Symbiosys at Sep 23, 2010, 11:41 PM

      Obviously modx is interpreting this as some sort of variable: "[[2,0]]".
      So obvious question is, how can i get this to render without being interpreted the wrong way my modx.

      Double brackets are standard MODx tag opening/closing, so you can adjust JavaScript to avoid them being parsed out:
      [ [2, 0] ]
        • 29089
        • 13 Posts
        Thanks for your quick reply. Works like a charm. I knew it was simple, I’m just not very experienced with JS so didn’t realise i could space out the brackets.

        Again, thanks.