Question: I'm quite new to using Phaser and the Tiled map editor and I'm currently making a platformer game using a Tiled map I made. I haven't been able to find any information in the Tiled or Phaser documentation, or in tutorials or forums on how to select a layer in my Tiled map to be a collision layer. In some tutorials I've seen people set a Tiled layer property to collision:true but I think they were using a different Tiled version and I can't see any information on this in the Tiled documentation.

I have 3 layers plus one layer for objects. I've put all the collision tiles in one layer that includes things like the ground and platforms. I've read answers saying that you need to include the index of the collision tiles but I don't want to include individual tiles as there a lot of tiles used. I've included a screenshot of my Tiled map JSON file, the layer I want to make a collision layer is called "Tile Layer 2". I'm not sure if I need to mention this layer name in my Phaser code to make it a collision layer or if I need to set the layer to collision: true in Tiled. I'd really appreciate any suggestions on how to make this a collision layer either using Tiled or Phaser. Thanks.

[Tiled map JSON file](http://i.stack.imgur.com/Fksvc.png)

Answer: 
```
$(document).on("load", ".load-next-page", function(){
    myApp.activities.myFunction1();
});

```

Each time document element is loaded the function is triggered.
If IE8 is not a constraint, use the DOMSubtreeModified event for this.
try `Promises` like [Q](https://github.com/kriskowal/q/) 
and then using `.then()`

or [jquery `.promise()`](https://api.jquery.com/promise/) 
like `$( "div" ).promise().done(function() {...`

you can read more about it [hare](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise) and [hare](http://www.html5rocks.com/en/tutorials/es6/promises/)