<script type="text/javascript" src="../../JSLibrary/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../../JSLibrary/jquery.SPServices-0.4.8.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var managerName;
var userName = $().SPServices.SPGetCurrentUser();
$().SPServices({
operation: "GetUserProfileByName",
async: false,
AccountName: userName,
completefunc: function (xData, Status) {
managerName = $(xData.responseXML).text();
var managerLength = managerName.length;
var indexofManager = managerName.indexOf("Manager");
managerName = managerName.substring(indexofManager + 13, managerLength);
var indexOffalse = managerName.indexOf("false");
managerName = managerName.substring(0, indexOffalse);
}
});
var peoplepicker = $("tr:contains('Reporting Manager'):last").find("div[title='People Picker']");
peoplepicker.html(managerName);
});
Above code will help you to get manager.You can set it to any of the control & get it from there in Client side code. I had set it to SharePoint People Picket for an example here.
It is surely working in SharePoint Foundation 2010.