When someone like me puts a lot of markup and javascript inside posts there is always a risk to create conflicting ids and names. One solution is to create a naming convention. Therefore a good idea will be to create master functions (or classes if you like) that contain all the javascript code, and the markup to be inserted using javascript also. The class function will have a name like xunClass_12345678, the instance of the class the name like xunInstance_12345678, while markup elements something like xun[Markup]_12345678_1234, where 12345678 is a unique alphanumeric id for the class and is identical for the instance and any markup, while for markup the last 1234 is a unique id in that area. See the source code for this post for an example.
2010-01-01
Abonați-vă la:
Postare comentarii (Atom)




Niciun comentariu:
Trimiteți un comentariu