我在母版页中添加了以下代码。我能够得到alert("I am in onload Function");
,但 jQuery("uploadPic").dialog 不起作用。页面上显示的<div>
部分。
我正在使用对 jQuery 的引用是
<script type=text/javascript src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.4.min.js"></script>
我也试过$('#uploadPic').dialog
。但没有奏效。
<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("onloadFunction");
function onloadFunction() {
alert("I am in onload Function");
//setup edit person dialog
jQuery("uploadPic").dialog({
autoOpen: false,
modal: true,
height: 375,
width: 400,
draggable: true,
title: "Upload Picture",
open: function (type, data) {
$(this).parent().appendTo("form");
}
});
}
function showDialog(id) {
alert("Hi");
$('#' + id).dialog("open");
alert("End");
}
</script>
<map name="Map">
<area shape="rect" coords="225,16,287,33" href="/_layouts/MyAlerts.aspx" onclick="javascript:showDialog('uploadPic');" alt="My Alerts">
</map>
<div id='uploadPic'>
<table class="ms-authoringcontrols" style="border-top:1px black solid; border:1px black solid; height:70px " >
<tbody>
<tr>
<td class="ms-sectionheader ms-rightAlign">
Please choose a picture to upload to your picture library.
</td>
</tr>
</tbody>
</table>
</div>