JavaScript widget

Can someone help me find a way of including a two-line JavaScript widget in a listing? The script needs to use one of the listing's custom fields to work.

Cheers!