I've included the pnp js file from a file system path and then referring it to html file
but i'm unable to get the sp web object. here is my code in html head tag
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="C:/work/pnp.js"></script>
<script>
var webUrl = "http://serverName:2016";
$(document).ready(function() {
var web = new Web(webUrl);
console.log(web);
web.lists.getByTitle("Employee").items.select("Title").get().then((items: any[]) => {
console.log(items);
});
var web = $pnp.sp.web(webUrl);//web is undefined
});
</script>
</head>
Local resource can't be used <script src="C:/work/pnp.js"></script>. A script should be hosted on the web (locally in SP, CDN, etc.). Closing this issue as not related to the library at all.
I've included the pnp js file from a file system path and then referring it to html file but i'm unable to get the sp web object. here is my code in html head tag