I added below code in the masterpage. I am able to get alert("I am in onload Function");
, but jQuery("uploadPic").dialog not working. The <div>
portion showing on the page.
I am using reference to jQuery is
<script type=text/javascript src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.4.min.js"></script>
I tried $('#uploadPic').dialog
also. But did not work.
<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>