Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: SPServices in IE8 on a SharePoint 2007 Site

I hope you don't tire of this, but I appreciate the work each of you takes to help the SharePoint community at large.

I've run into a bit of a problem on my SharePoint 2007 site and hope the experts that haunt this forum can come to the rescue. I have found and used a script that uses SPServices to display the contents of a list in a CEWP. Here's the code:
<script type="text/javascript" src="https://MySite/Documents/jquery.js"></script>
<script type="text/javascript" src="https://MySite/Documents/jquery.SPServices-2013.01.min.js"></script>

<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $().SPServices({
            operation: "GetListItems",
            async: false,
            listName: "My Status",
            CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Status1' /><FieldRef Name='Status2' /><FieldRef Name='Status3' /></ViewFields>",
            completefunc: function (xData, Status) {
                $(xData.responseXML).SPFilterNode("z:row").each(function() {
                    var liHtml = "<li><div class='item'>" + $(this).attr("ows_Title") + "<br>" + "<div class='gumballs'><div class='stat'>" + $(this).attr("ows_Status1") + "</div>&nbsp;<div class='stat'>" + $(this).attr("ows_Status2") + "</div>&nbsp;<div class='stat'>" + $(this).attr("ows_Status3") + "</div></div></div></li>";
                    $("#itemsUL").append(liHtml);
                });
            }
        });
    });
</script>

<ul id="itemsUL"/>
The great news is that this works as expected in Chrome and even in IE10 (using IE10 Standards and IE9 Standards). But must of my users are going to be running IE8 and the list data do not appear either in IE8 Standards view or on the actual IE8 browser. Given the listing above, what do I need to do to get the list data to appear in IE8?

In my research it appears IE8 doesn't support addEventListener and the workaround is to use attachEvent instead, but I don't know how to do this. I took the time to look through SPServices' documentation and forums and couldn't find anything on this.

Viewing all articles
Browse latest Browse all 6517

Trending Articles