Module:GetJSON: Difference between revisions

From AlternateWiki
839 bytes added ,  1 month ago
Created page with "local p = {}; p.main = function( frame ) local m = {} m.root = mw.loadJsonData(p.args[1]) if m.root[p.args[2]] ~= nil then return m.root[p.args[2]] else if p.args[3] ~= nil then return p.args[3] else return "" end end end return p --All modules end by returning the variable containing their functions to Wikipedia. -- Now we can use this module by calling {{#invoke: Example | hello }}, -- {{#invoke: Example | hello_to | foo }}..."
(Created page with "local p = {}; p.main = function( frame ) local m = {} m.root = mw.loadJsonData(p.args[1]) if m.root[p.args[2]] ~= nil then return m.root[p.args[2]] else if p.args[3] ~= nil then return p.args[3] else return "" end end end return p --All modules end by returning the variable containing their functions to Wikipedia. -- Now we can use this module by calling {{#invoke: Example | hello }}, -- {{#invoke: Example | hello_to | foo }}...")
(No difference)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.