Select to view content in your preferred language

What exactly goes into the init(ial) function?

1158
1
11-16-2011 07:38 AM
MikeOnzay
Frequent Contributor
I've seen some samples where only the basics of defining and adding a map are there. I've seen some samples where there are functions and/or functions that respond to events are in there. I've seen some samples where these functions are outside of the init function. What is the general idea or best practices of what should go inside your init function be? Is there another document or web page that explains this?
0 Kudos
1 Reply
derekswingley1
Deactivated User
My thoughts on this are that you should put in the bare minimum required to get your app up and running. For most JS API apps, this means creating a map, adding some layers and setting up your app's basic functionality and/or UI. That last point is wide open depending on what you're app does. Apologies if this is too vague/general but the answer will vary from app to app.
0 Kudos