0
我想将一些内联代码移入一个函数。从Onclick内联功能代码问题
这个工程:
<img onclick="window.plugins.socialsharing.share('Mesasage: ' + $('#divA').html() +' - '+$('#divB').html()+' cars - '+$('#males_count_pecentage').html()+' bikes', 'subject here', 'http://mysite/image.png', 'http://abc.go.com')" src="images/share_text.png" style="height:2em" />
但是,当我这样做:
function myfunc() {
alert('hello');
window.plugins.socialsharing.share('Mesasage: ' + $('#divA').html() +' - '+$('#divB').html()+' cars - '+$('#males_count_pecentage').html()+' bikes', 'subject here', 'http://mysite/image.png', 'http://abc.go.com');
}
,这称之为从功能:
<img onclick="myfunc();" src="images/share_text.png" style="height:2em" />
什么也没有发生。
我在这里忘记了什么吗?
你有没有检查错误控制台? –
是的,没有错误 – Satch3000
你有警报? –