Get plugin options from inside JS
Hazulu
New
Hello~
I was wondering if there's any way to grab data from a plugins setting from within a js file. I'd just want to pull the number value from a setting and use it in a function. Thank you
.
0
Comments
In your plugin:
$Sender->AddDefinition('Specialnumber', C('Plugins.MyPlugin.SpecialNumber', 5));Javascript:
alert('The special number is ' + gdn.definition('SpecialNumber'));Note that gdn.definition() returns the given string if the definition is not set (which Javascript evaluates to true in a condition), as it is mostly used for translations. In the future, gdn.getMeta() should be used for everything that is not a translation.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS