Hi, following the guide at http://sympmarc.com/2011/07/08/adding-jqueryspservices-to-a-sharepoint-page-step-one-always/, I've added the below code to my page. Ctrl+Clicking the script references works fine. When I try it on the page, the first SPGetCurrentSite() alert works fine. The second SPGetCurrentSite() alert inside the document.ready function gives the following error:
"Unable to get value of the property 'SPGetCurrentSite': object is null or undefined"
Why is it working outside of the document.ready function, but not inside?
"Unable to get value of the property 'SPGetCurrentSite': object is null or undefined"
Why is it working outside of the document.ready function, but not inside?
<script type="text/javascript" src="/JQuery/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/JQuery/jquery.SPServices-0.7.2.min.js"></script>
<script type="text/javascript">
alert($().SPServices.SPGetCurrentSite());
$(document).ready(function() {
alert("jQuery");
alert($().SPServices.SPGetCurrentSite());
});
</script>