Fixed Javascript: Extra params for Autocomplete field

sonnb

Well-known member
Currently XenForo use this to pass extra params from data attribute to POST data.

Code:
if ($input.data('acOptions'))
            {
                options = $.extend(options, $.parseJSON($input.data('acOptions')));
            }

But since this example
Code:
data-acoptions="{"extraParams":1}"

would be automatically parsed as Object when calling: $input.data('acOptions'). It would not able to pass any params as parseJSON returns null.

It should be (without parseJSON).
Code:
if ($input.data('acOptions'))
            {
                options = $.extend(options, $input.data('acOptions'));
            }
 
Back
Top Bottom