How can I create an ajax on/off toggle?
In the javascript you should format the data as an object:

data: 'js=1'


replaced with

data: {js: 1}


The problem with the redirect is most likely an JS error caused by the returning value of the ajax callback. To be able to spot it you can hardcode the url in development and change the link simple be &lt;a href="#"&gt;xx&lt;/a&gt;, that would prevent a new page from loading in case of JS errors and would give you the possibility to read the error log from tools like firebug. Another options would be to insert breakpoints in your JS code, which can be a bit more tricky.