ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: emanuele on July 14, 2014, 09:06:30 am

Title: Admin search results javascript error
Post by: emanuele on July 14, 2014, 09:06:30 am
Code: [Select]
function showhideJqueryOptions() {
var jqBase = document.getElementById('jquery_default').checked,
jqUi = document.getElementById('jqueryui_default').checked,
jqBase_val = $('#jquery_version'),

Code: [Select]
Unhandled Error: Cannot convert 'document.getElementById('jquery_default')' to object
Title: Re: Admin search results javascript error
Post by: emanuele on July 14, 2014, 10:14:13 am
Now I got it: this is a more general issue, I think.
The "good practice" should be that we do not use addInlineJavascript in the method that defines the array (_basicSettings in that case), but in the "display" one (action_basicSettings_display).
That way, when the settings are required for the search, the javascript and bits are not added to the template.
Title: Re: Admin search results javascript error
Post by: Spuds on July 14, 2014, 10:15:31 am
Oops ... that addInlineJavascript('showhideJqueryOptions();', true); should not be in action_basicSettings_display not in _basicSettings ... I'll add that to my PR



ETA: yeah what he said while I was typing that :P