You can use the getDialog () method of the CQ.WCM class to get the dialog object for the URL. In addition, you can also pass a configuration object to perform functions such as caching a dialog, searching for a dialog in the cache, etc.
var dialog = CQ.WCM.getDialog(pathToDialog + ".infinity.json");
source share