On Tue, 21 Jul 2015 at 18:49:01, Marcel Korpel wrote:
* Lukas Fleischer <lfleischer@archlinux.org> (Tue, 21 Jul 2015 18:34:27 +0200):
+ _this = $(this);
Do we need an extra variable here?
Yes, we need to copy 'this' here to be able to use it within the callback function, where 'this' has a different meaning.
Sounds sensible. Thanks for clarifying!
+ pkgbase_name: '<?= htmlspecialchars($pkgbase_name) ?>'},
Can we use htmlspecialchars() here? If it is the right function to use, we need to add ENT_QUOTES at least...
Nope, we need json_encode() here.
Okay!
+ function (data) {
Broken indentation?
Why? I indented all parameters with one tab, putting them on one line creates a very long line.
Not sure. Looking at the existing JavaScript code in our code base, it seems like we prefer the following indentation style: $.getJSON([...], { [...] /* parameters here */ }, function(data) { [...] /* function body here */ });
You're correct about all the other things you mentioned.