Welcome

Sharepoint lead is a place where you can read about interesting topics related to sharepoint, and you can also post comments and suggessions.
Showing posts with label browser problems. Show all posts
Showing posts with label browser problems. Show all posts

Wednesday, May 16, 2012

SP.UI.ModalDialog.showModalDialog not working in chrome

In some version of browser, using will not work due to some reason. I found an alternate method to solve this problem, here is the javascript code:
var dialogSP = null;
if (SP.UI.ModalDialog.showModalDialog) {
    dialogSP = SP.UI.ModalDialog.showModalDialog(options);
} else {
    dialogSP = SP.UI.ModalDialog.commonModalDialogOpen(countryUrl, options, null, {});
}

jQuery.find not working in IE7 for xml data


As part of troubleshooting a shareoint functionality, we found that jQuery.find not working.
We were using jQuery.ajax to call a sharepoint web service and in success function, finding an element in response xml to render it on div.
We fixed this and there are couple of options to fix this that we found from stackoverflow.
1. add dataType: 'xml​' in jQuery.ajax and that will fix it.
2. in response, check for browser is IE7 and variable that is having data is blank, do it with another method, here is javascript code:
if ($.browser.msie && liHtml == "") {
    xml = new ActiveXObject("Microsoft.XMLDOM");
    xml.async = false;
    xml.loadXML(response);
    liHtml = $("XmlTagNameToFind",xml).text();
}
I hope this will he you as well.