Friday, June 5, 2015

Javascript in crm 2013

JavaScript libraries are Script (JScript) web resources that contain functions you can use to:




  1. Handle form and field events.
  2. Perform actions for controls configured in the Ribbon.
  3. Support other functions.





JavaScript programming best practices

1.Avoid using unsupported methods
2.Use a cross-browser JavaScript library for HTML web resource user interfaces
3.Do not use jQuery for form script or commands
4.Recognize limitations for content delivery network (CDN) libraries
5.Use feature detection when writing functions for multiple browsers
6.Do not access the DOM
7.Define unique names for your JavaScript functions
8.Use asynchronous data access methods


Execution context


Each event handler can be configured to accept an execution context object as the first parameter. The execution context includes functions that can be called to determine:


Depth: The relative order in which this handler is executed.


Event Source: A reference to the object that initiated the event.


This capability is important when you’re creating a function that may respond to events from several different form or field events.


Shared Variables: This allows a function to set a variable as a key/value pair that can be accessed by other event handlers.

No comments:

Post a Comment