Bug Tracker

Opened 8 years ago

Closed 8 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 8 years ago by chriswu000

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

comment:2 Changed 8 years ago by timmywil

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.

Note: See TracTickets for help on using tickets.