Is there a way to stop the .data() function from converting the data to another type?
For example, with the HTML
Use .attr() instead of .data():
$("div").attr("data-code-name")
http://jsfiddle.net/dMHS4/1/
Taken from the jQuery documentation:
Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null) otherwise it is left as a string. To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method