Javascript + XenForo Options

Daniel Hood

Well-known member
Are the options set in the admin panel accessible through the XenForo javascript object? I tried
Code:
console.log(XenForo.options);
but it said undefined.
 
hmmm... alright. Is there a buildLink function or something I can use then? I needed options for something else but I also need to be able to build a path.
 
Best thing to do is use data- attributes on HTML elements if appropriate.

They're used a lot in XenForo. Mostly to pass options and other data to JavaScript functions.
 
Yup, I concur with data-attributes. They are extremely useful when it comes to storing necessary information (XenForo uses them extensively).
 
Back
Top Bottom