User talk:Danski454/unwatch.js

AJAX?
Would it be possible to click to unwatch without leaving the current page? Perhaps with an AJAX method? ~ ★ nmaia d 10:54, 6 May 2019 (UTC)
 * ✅: just add  to your common.js (I left the old code in for those who still want it). --Danski454 (talk) 12:16, 6 May 2019 (UTC)
 * Awesome, thanks! :) ~ ★ nmaia d 12:21, 6 May 2019 (UTC)
 * Did I... do this right? It didn't work for me. ~ ★ nmaia d 12:25, 6 May 2019 (UTC)
 * That should work, what is happening instead? Danski454 (talk) 12:31, 6 May 2019 (UTC)
 * I'm still being directed to another page when I click [unwatch], same as before your modifications. No errors on my browser (Firefox) console. ~ ★ nmaia d 12:35, 6 May 2019 (UTC)
 * That should not happen, have you tried clearing your cache? --Danski454 (talk) 12:40, 6 May 2019 (UTC)
 * you should actually clear it. Danski454 (talk) 12:41, 6 May 2019 (UTC)
 * I tried Ctrl+F5, to no avail, and then cleared cache and cookies from en.wikipedia.org, also to no avail. ~ ★ nmaia d 12:44, 6 May 2019 (UTC)
 * this probably won't work, but try moving the  before the mw.loader.load statement. Danski454 (talk) 12:49, 6 May 2019 (UTC)
 * Still didn't work. I tried using Ctrl+F5 and all. ~ ★ nmaia d 13:28, 6 May 2019 (UTC)

what happens if you run the code  in the console? I'll probably need to ask WP:VPT anyway. Danski454 (talk) 13:37, 6 May 2019 (UTC)
 * Running that returns . FWIW, on meta I get the same issue. ~ ★ nmaia d  14:14, 6 May 2019 (UTC)
 * I think I've found it. Replace  with  . It seems that code in global.js is run in a different scope. Danski454 (talk) 14:21, 6 May 2019 (UTC)
 * It works! You rock! Thank you. You might want to document these two variables as a comment on the code for future users :) ~ ★ nmaia d 14:25, 6 May 2019 (UTC)