我正在努力找到通过附加功能的
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中,但无法弄清楚如何……
而且我似乎无法绕过创建使用单个和双重qoutation标记的html元素.
任何建议将不胜感激.