HTML5 AppArgs
Monkey Forums/Monkey Code/HTML5 AppArgs
| ||
#If TARGET<>"html5" Import os #Else Extern Global _search:String="(window.location.search || ~q~q)" Global _hash:String="(window.location.hash || ~q~q)" Public Function AppArgs:String[]() Local hash:String = _hash[1..] Local search:String = _search[1..] Local args:String[] If search.Length()>0 args = search.Split("&") Else If hash.Length()>0 args = hash.Split("&") End Return args end #end Example: http://url/MonkeyGame.html?test=1&start=here Or http://url/MonkeyGame.html#test=1&start=here |
| ||
Thanks! This seems really useful ! |
| ||
could be used for passing in coupon or codes to reward people with stuff in game, like hay all here is a free rocket launcher code for gameX ROCKET11111 could do little promotions to promote people to play more, could also be used for metrics and some ... other .. stuff. |
| ||
The DOM module also has the window.location stuff. |
| ||
Yea thats true, but i don't want import the complete dom module for that ;) |
| ||
Voucher codes?! Crunch some data, and URL-a-size entire levels!! Thanks, I'll be making good use of this :D |