Script Includes - name must start with a capital letter?

ninnesr
Kilo Contributor

Can someone please confrim or deny the fact that the name of a script include/GlideAjax must start with a capital letter?

I've been trying to get the below GlideAjax to work for a while now and just discovered this fact

//script include name = Asdf
var Asdf = Class.create();
Asdf.prototype = Object.extendsObject(AbstractAjaxProcessor, {
confirmOrgChanges: function() {
. . . .
//WORKS


//script include name = asdf
var asdf = Class.create();
asdf.prototype = Object.extendsObject(AbstractAjaxProcessor, {
confirmOrgChanges: function() {
. . . .
//DOES NOT WORK


This is really annoying. . . is there a reason for this?

8 REPLIES 8

tony_fugere
Mega Guru

It is a common naming convention that a class starts with a capital letter. See all of the other examples in the OOB Script Includes as well as the HelloWorld example in the Wiki. This keeps a visual segregation from "normal" variables that should start with a lowercase letter.



tony.fugere
AFAIK it's not a mandatory convention in javascript, perhaps mention of this requirement should be included on the GlideAjax and Script Includes wiki pages.



ninnesr


Precisely why I chose the word common, not mandatory... 🙂


ninnesr


I agree, send a PM to one of these three folks to request for Wiki enhancements:

wally.marx
joe.employee
guy.yedwab



tony.fugere


😄 Yup (I guess if I followed the norm, I wouldn't have encountered this problem :P) I was just highlighting the fact that SN has made it madatory.

Thanks for the names, I'll send off a PM