erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

Fixing invalid JSON when parsing empty attributes #59

Closed joshball closed 11 years ago

joshball commented 11 years ago

Hey Eric, I noticed that using the latest jQuery, the parsing throws an exception for empty attributes. Here is a fix. Thanks!

An empty string (or null object) is invalid JSON, and needs to be converted to a 'null' string. jQuery 1.9.0 has exposed this previously accepted JSON. Now we need to convert it.

http://forum.jquery.com/topic/parsejson-in-1-9-0-is-different-from-earlier-versions Currently, if using jQuery 1.9.0, this code will throw an exception when dealing with empty validation attributes.

erichexter commented 11 years ago

I appreciate your pull request, will please submit this contributor agreement. http://sdrv.ms/13eMRXm this will help keep the project compliant with our open source license.