我在 jsp 页面上写一个按钮,点击按钮弹出对话框。代码如下:


<a href="javascript:buy();" class="weui_btn weui_btn_primary">立即购买</a>
function buy(){
		$.confirm("您确定要购买杯子吗?", "确认购买?", function() {
		      $.toast("购买成功!");
		    }, function() {
		      
		 });
	}

页面不弹出对话框,向各位请教,谢谢。 



杨__羊羊
浏览 213回答 1
1回答

肥皂起泡泡

function buy(){&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; var a=confirm("您确定要购买杯子吗?")&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; if(a==true)&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert("购买成功!");&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert("放弃购买")&nbsp;&nbsp; &nbsp; }
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JQuery