Possible Duplicate:
Large numbers erroneously rounded in Javascript
I am using jQuery.parseJSON() to take a json string and make it an object. The json string is placed in a script tag by our server with the initial markup. The json string contains values that reference different resources on our website.
There's problem in the implementation of this that was overlooked in development, and is now starting to rear it's head. Our server is java based. Numeric values are for the most part represented as Longs. So the json string will have things like "...'id': 25783071737028608...". This is a problem because this value exceeds the max value for a JS Number type by two whole powers of 10. In this case the number get rounded up: 25783071737028610, which causes all sorts of data inconsistency issues.
This type of pattern is ubiquitous on our website, and the values represent values from our database. I want to avoid doing a massive refactoring of the database. I also want to avoid just passing things to the browser as strings ("...'id': "25783071737028608"..." because finding every instance of a long being passed to javascript, would require a massive refactor of our database.
Is there anyway to represent a Java long type in JavaScript? If no (which I believe to be the case) is there any creative work arounds that you might have used to resolve similar issues?