Opened 11 years ago
Closed 11 years ago
#10604 closed enhancement (wontfix)
$(...).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
Change History (2)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | unfiled → manipulation |
---|---|
Priority: | undecided → low |
Resolution: | → wontfix |
Status: | new → closed |
Type: | bug → enhancement |
This is feature creep. It is far too simple to pass a string or function.
Note: See
TracTickets for help on using
tickets.
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