hi,
I have 2 webparts(1 is .dwp webpart another custom webpart). I have one common function to get data from list via client object model.I have added 2 webparts to a page. am getting "$lineinfo is undefined" Error. those 2 webpart working properly when I added them to the diffrent pages. facing the problem when I have added them to the same page below is my code.
function retrieveListItems(wpName, wpClientId, wpImg) { var cookieValue = ReadCookie("Cookie"); if (cookieValue == null || cookieValue == "false") { gwpClientId = wpClientId; gwpImg = wpImg; var clientContext = new SP.ClientContext.get_current(); var oList = clientContext.get_site().get_rootWeb().get_lists().getByTitle('AlternateTextList'); var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name=\'Title\'/><Value Type=\'Text\'>"+ wpName +"</Value></Eq></Where></Query><ViewFields><FieldRef Name=\'AlternateText\' /></ViewFields></View>"); this.collListItem = oList.getItems(camlQuery); clientContext.load(collListItem); clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); } } function onQuerySucceeded(sender, args) { var altText = ''; var listItemEnumerator = collListItem.getEnumerator();//got error here while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); altText = oListItem.get_item('AlternateText'); } changeHtml(altText); }
2 webparts calling retrieveListItems() first. onQuerySucceeded() method is getting executed by first webpart after 2nd webpart completes retrieveListItems method.while debugging it is showing "$lineinfo is undefined" error.In IE error msgs shown as "request alredy opened".jquery js reffered in both the webparts. used executeordelayuntilscriptloaded before calling method in both the webparts.
anyone have idea abt this problem ?
thx