I am trying to move a file from one folder to another on my SharePoint 2013 server. I tried using the answer with 5 upvotes on this link: How do I move files from one document library to another using JSOM?.
But, when the script hits var folderSrc = web.getFolderByServerRelativeUrl(sourceLib);
, an error message appears in the console:
Object doesn't support property or method 'getFolderByServerRelativeURL'
I'm guessing web
was not properly loaded. What do I need to do to load web
correctly?