http://item.taobao.com/item.htm?id=21456688754&ali_refid=a3_420763_1007:1102249745:7:4043f4c103d9bc6af0a150eaaa84293d:809ab74692c8b2532811f1c84fbbe72b&ali_trackid=1_809ab74692c8b2532811f1c84fbbe72b
正则
------解决方案--------------------
var str="http://item.taobao.com/item.htm?id=21456688754&ali_refid=a3_420763_1007:1102249745:7:4043f4c103d9bc6af0a150eaaa84293d:809ab74692c8b2532811f1c84fbbe72b&ali_trackid=1_809ab74692c8b2532811f1c84fbbe72b";
alert(str.match(/id\=(\d+)&/)[1]);
------解决方案--------------------
var str="http://item.taobao.com/item.htm?id=21456688754&ali_refid=a3_420763_1007:1102249745:7:4043f4c103d9bc6af0a150eaaa84293d:809ab74692c8b2532811f1c84fbbe72b&ali_trackid=1_809ab74692c8b2532811f1c84fbbe72b";
alert(str.match(/[^a-zA-Z]id=(\d+)/)[1])