Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

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
Description

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/

AttachmentSize
Picture 3.png7.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...