midasplatform/slicerappstore — Issue #21: index/index.phtml - Add js variable into a namespace ?
Author: jcfr
Created: 2012-02-20 15:29:42+00:00
State: open

@zachmullen and @cpatrick: Is adding JS code to a div the recommended / standard midas way to expose data to JS ?

* https://github.com/midasplatform/slicerappstore/blob/master/views/index/index.phtml#L121
* https://github.com/midasplatform/slicerappstore/blob/master/public/js/index/index.index.js#L135

Using jsonContent div may conflict with some other code, what about using an explicit namespace ?
For example: https://github.com/midasplatform/slicerpackages/blob/master/controllers/ViewController.php#L267

Open question: What about using the api proposed by jquery? See http://api.jquery.com/data/