我有一个书签系统,当图像被加入书签时,我想要一个带图像的提醒,以确认图像被加入书签。
我有一个工作警报并且点击它显示警报。但是,警报还会显示加载页面的时间。我无法弄清楚如何仅在提交表单时显示提醒
代码:
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<!--form which sends field information to the database-->
<form class="form" id="form" action="" method="post" >
<img id="enlargedSymbol" type="text" size="60" name="pathOfSymbol" src='' /> <!--large symbol where source is inserted-->
<br />
<!--hidden input which value is set by query where then its sent to the database-->
<input class="inputBox" type="hidden" name="pathOfSymbol" id="pathOfSymbol" />
<script>
var querySrc = URI(window.location.href).search(true).src; //gets image source
//sets image source as enlarged symbol
$("#enlargedSymbol").prop("src", querySrc);
//sets path of symbol as hidden value
$('#pathOfSymbol').val(querySrc);
</script>
<button type="submit" name="submit" id="addToBookmarksButton" onclick="addedToBookmarks()" >
<img id="addToBookmarksButton" src="img/addToBookmarks.png" />
</button>
</form>
<script>
$(function addedToBookmarks () {
$("#dialog").dialog();
});
</script>
<div id="dialog">
<img src="img/addToBookmarks.png" alt="Placeholder Image" />
</div>
答案 0 :(得分:1)
<script>
$('#addToBookmarksButton').click(function(){
$("#dialog").dialog();
});
</script>