JavaScript Convention and GetPlayer()
Oct 24, 2012
By
Sam Carter
JavaScript convention holds that functions that begin with a capital letter are constructors. For example JavaScript Date, Boolean, Array.
Constructors are all used with "new".
Examples:
var myDate = new Date(), myBoolean = new Boolean();
Storyline gets off on a bad convention footing by capitalizing GetPlayer as it isn't a constructor function. Adding a new function getPlayer would adhere to convention and give back-compatibility as long as GetPlayer remained.
I'm just saying...
4 Replies
Can't tell you how many times my script has bombed out when I mistyped the function as getPlayer() and getVar() and setVar()... I agree, habits are hard to break.
do calls to "GetPlayer()" work locally if viewing HTML5 output?
Hi Jason...
Did you ever find the answer to this question?
Hi Mike,
This thread is a bit older so I"m not certain Jason is still subscribed. You may want to send him a private message just in case.
This discussion is closed. You can start a new discussion or contact Articulate Support.