我正在努力寻找通过附加功能的 javascript/jquery 添加按钮的正确语法。
现在我正在尝试:
list.append("<button onclick='getFeed('http://open.live.bbc.co.uk/weather/feeds/en/PA2/3dayforecast.rss, showFeedResults')'>ButtonTest</button>");
但它返回:
<button onclick="getFeed(" http:="" open.live.bbc.co.uk="" weather="" feeds="" en="" pa2="" 3dayforecast.rss,="" showfeedresults')'="">ButtonTest</button>
本质上,我希望能够创建
<button onclick="getFeed('http://open.live.bbc.co.uk/weather/feeds/en/B1/3dayforecast.rss', showFeedResults)" class="ui-btn-hidden">
在javascript中,但无法弄清楚如何..`
而且我似乎在创建同时使用单引号和双引号的 html 元素时遇到了麻烦。
任何建议将不胜感激。