Object doesn't support property or method 'get_file'

408 views Asked by At

I keep getting this error in IE only, the app works on Chrome. Whenever I run the app on IE it freezes up and throws a get_file error. Not sure why, because this error does not appear when using Chrome.

My code:

//Check Out New Design
function CheckOutFile() {
   var setWelcomePageURL = pagesRootFolder.substring(pagesRootFolder.lastIndexOf("/") + 1);
   var clientContext = new SP.ClientContext(siteRelURL);
   var webSite = clientContext.get_web();
   this.list = webSite.get_lists().getByTitle(setWelcomePageURL);
   this.item = list.getItemById(1);
   this.file = item.get_file(); //ERROR HERE <-------- WORKS IN CHROME THOUGH
   this.file.checkOut();
   clientContext.load(this.file)
   clientContext.executeQueryAsync(Function.createDelegate(this,    this.checkOut_Success), Function.createDelegate(this, this.checkOut_fail));
}

function checkOut_Success(sender, args) {
  //success code
}

function checkOut_fail(sender, args) {
 //fail code
}
0

There are 0 answers