I guess both methods are valid. Method one could be useful if it makes sense to have a data attribute. Although, if it makes sense to have a data attribute filled up with JSON, and if the json is simple enough, then you can surely convert the json file to "data-" element (for exemple, {"name" : "yo", "city" : "lo"} becomes 'data-name = "yo" data-city = "lo"') Also, if your concern is security (and also cleanliness of the code), you can also encode the JSON in base64 to avoid people reading too easily the data of the json file.
But methode 2 seem to make sense in most of the cases I can think of! Plus it is far more simple ! :) Cheers, Florent -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f5a1bfa0-9774-4307-9f44-28a3413a92b7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.