Our application uses a lot of configuration options. Those options need to be reflected on the client side in the form of User preferences, site wide preferences, etc.
Currently, we pass server side settings down to the client side in the form of JSON that is stored in custom attributes in the markup for a specific element (and no, our application currently doesn't worry about W3C validation). We then retrieve the data from the custom attribute, and parse it into a JSON object for use in script using jQuery.
One drawback to this is referencing attributes on elements from within event handlers. I know this is frowned upon, as it can create circular references, and subsequently memory leaks. I would much prefer to use jQuery's data function, but you can't invoke this from the server side at page render time.
What does everyone else do in this type of scenario?
asked Jan 4 '11 at 20:43
5,68944 gold badges2626 silver badges3838 bronze badges
- How do you store bottles after sterilizing
- What are the best documentaries about statistics
- Tan3A TanA a then sin3A sinA
- What is 7 12 15 25
- Where are the good people mostly found
- Should young Christians listen to Ben Shapiro
- Can you leave maple syrup out
- Are Filipinos still worth dying for
- What are some cheesy 80s movies
- What is 5+x x 3
- Does electricity use fossil fuels
- How can I learn paid advertising easily
- Why cant I relish Ayn Rands books
- Do you like Philadelphia
- What are pre coins in empowr
- What was in your golden parachute
- Is Jesus the Holy Spirit