buttons object includes toJSONString method if using JSON.js
| Project: | Impromptu |
| Version: | 1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I am using the JSON.js file which adds methods to Object.prototype. One method in particular, toJSONString is being added to all objects. When I pass an object containing the button names and values to the prompt function, toJSONString is automatically added. The result is that toJSONString shows up as a button. My code looks something like this (screenshot of result is attached):
<script src="json.js" type="text/javascript" ></script>
...
$.prompt(msg, { buttons: { "Thisa got": true, "Cancel thata": false },
callback: incomingOfferDialogAction,
container: "html",
opacity: 0.8,
show:"fadeIn",
overlayspeed: 0
}); I don't know what the best solution for this is, but it seems that prompt() should be able to account for additions to Object.prototype. This blog post has a suggestion, but I don't know how to make their solution work with the existing impromptu code.
http://yuiblog.com/blog/2006/09/26/for-in-intrigue/
| Attachment | Size |
|---|---|
| Picture 3.png | 7.25 KB |

Comments
#1
i did $('#msgPromptbuttontoJSONString').hide(); immediately after the impromptu call and that temporarily fixed it... :)
where msgPromptbuttontoJSONString is the id of the toJSONString button attached...