var ohtml='<div class="friend-dialog tac pt15 pb20">'+ '<div class="f-h32">您已經成功發送好友申請。</div>'+ ' <p class="c999">上傳真實頭像,好友申請更容易被通過哦,趕緊上傳頭像吧!</p> '+ '<a href="<%=path%>/teacher/editUserAvatar.action" target="_blank"><span id="awindowopen" ></span></a>'+ ' </div>'; $.dialog({ lock:true, title: '溫馨提示', button: [ {value: '點擊上傳圖像',callback: function () { $("#awindowopen").trigger("click"); },focus: true } ], content:ohtml }); var ohtml='<div class="friend-dialog tac pt15 pb20">'+ '<div class="f-h32">您已經成功發送好友申請。</div>'+ ' <p class="c999">上傳真實頭像,好友申請更容易被通過哦,趕緊上傳頭像吧!</p> '+ '<a href="<%=path%>/teacher/editUserAvatar.action" target="_blank"><span id="awindowopen" ></span></a>'+ ' </div>'; $.dialog({ lock:true, title: '溫馨提示', button: [ {value: '點擊上傳圖像',callback: function () { $("#awindowopen").trigger("click"); },focus: true } ], content:ohtml });
需要注意的是:
在這個地方:
<a href="<%=path%>/teacher/editUserAvatar.action" target="_blank"><span id="awindowopen" ></span></a> <a href="<%=path%>/teacher/editUserAvatar.action" target="_blank"><span id="awindowopen" ></span></a> <a>標簽內一定要有內容,並且要模擬裡面的內容被點擊而不是<a></a>被點擊