{"issue":{"created_at":"2011-12-03T00:38:18Z","state":"closed","updated_at":"2011-12-13T18:57:30Z","user":{"gravatar_id":"6401139bc99de224a54a0883d52f7378","id":407497,"url":"https://api.github.com/users/pehrlich","avatar_url":"https://secure.gravatar.com/avatar/6401139bc99de224a54a0883d52f7378?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"pehrlich"},"comments":3,"body":"Currently, any unexpected response to loadpage will render a blank page saying \"undefined\".  It would be really nice (and I think quite simple) to turn this in to an extension point instead.  When responseHeaders are not html, trigger a custom handler with the data.\r\n\r\nIn concert with this, the code which shows the yellow error dialog could be move in to its own accessible method.  Which could, in turn, be used by such a handler.\r\n\r\nThis could be used by json data returned from server errors or in a more lightweight form validation.\r\n\r\nThoughts?","assignee":null,"id":2434836,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":3212,"labels":[{"name":"1 - Feature Request","color":"d5fa3f","url":"https://api.github.com/repos/jquery/jquery-mobile/labels/1+-+Feature+Request"}],"title":"Feature request - handle text/json response","html_url":"https://github.com/jquery/jquery-mobile/issues/3212","closed_at":"2011-12-12T23:06:04Z","url":"https://api.github.com/repos/jquery/jquery-mobile/issues/3212","milestone":null},"action":"created","comment":{"created_at":"2011-12-13T18:57:29Z","updated_at":"2011-12-13T18:57:29Z","user":{"gravatar_id":"6401139bc99de224a54a0883d52f7378","id":407497,"url":"https://api.github.com/users/pehrlich","avatar_url":"https://secure.gravatar.com/avatar/6401139bc99de224a54a0883d52f7378?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"pehrlich"},"body":"Hmm.  It looks like I can latch on to pageload event and there scan data.xhr.getResponseHeader('Content-Type') for json, calling any necessary handlers and stopping further propagation.\r\n\r\nAt this point data.page has already been populated (with undefined content) and added to the dom- a possibility for optimization.\r\n\r\nWould still be great to be able to access that dialog independently. \r\n\r\nAdded to the wiki!","id":3127597,"url":"https://api.github.com/repos/jquery/jquery-mobile/issues/comments/3127597"}}