Skip to main content

Bug Tracker

Side navigation

#10604 closed enhancement (wontfix)

Opened October 27, 2011 10:42PM UTC

Closed November 01, 2011 11:33PM UTC

$(...).html(object) should use its custom toString() method.

Reported by: jdalton Owned by:
Priority: low Milestone: None
Component: manipulation Version: 1.7b2
Keywords: Cc:
Blocked by: Blocking:
Description

I was messing around with $(...).html(....) and was surprised that it didn't use my object's custom toString() method.

You can see an example here:

http://jsbin.com/uqazuk

Attachments (0)
Change History (2)

Changed November 01, 2011 09:06PM UTC by chriswu000 comment:1

According to the jquery docs, the html method only expects a string or a function:

http://api.jquery.com/html/

I don't know if the interface should be changed, but here is a patch that will do it:

https://github.com/chriswu000/jquery/commit/66920cfeb2c488eb377b1ce4e1246dcd44c5359f

Changed November 01, 2011 11:33PM UTC by timmywil comment:2

component: unfiledmanipulation
priority: undecidedlow
resolution: → wontfix
status: newclosed
type: bugenhancement

This is feature creep. It is far too simple to pass a string or function.