- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2014 02:38 PM
Came across a few examples where out-of-box code may reference gs.include('ScriptInclude');
But then what would be the difference (if any) in using
gs.include('ScriptInclude');
versus
var foo = new NewInclude();
I'm curious as to the differences and/or the advantages.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2014 12:08 AM
Hi Daniel,
gs.include() allows you to call a script include and use the functions in that script include within your current script include i.e you do not have to copy the functions into your current script include, but rather you can call them directly.
var foo = new NewInclude() initializes an object for the script include NewInclude. Now any function that you have defined within this script include class can be called directly using foo:-
eg:-
var NewInclude = Class.create();
NewInclude.prototype = {
initialize : function() {
},
myFunction : function() {
//do something
},
type : 'NewInclude'
};
Usage:-
var foo = new NewInclude();
foo.myFunction();
Thanks & Regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2024 11:19 AM
The video in the above link is no longer available. Would you be able to re-share the link please?