1

I'm trying to display an image, content and a link to open new list item dialog box. This is working in Firefox, but in IE it gives the error "wrong number of arguments or invalid property assignment".It is showing this error in the jquery 19.0 min.js file. Any idea on what is wrong?

    <head>
    <script type="text/javascript" src="http://mysiteurl</Javascript/jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="http://mysiteurl/jquery.SPServices-2013.01.min.js"></script>
    <script type="text/javascript">

       function OpenDialog() {.
           var options = {
            url: "http://mysiteurl/_layouts/listform.aspx?PageType=8&ListId={list guid}",
            autoSize: true,
            allowMaximize: true,
            title: 'Add your story',
            showClose: true,
            };
            var dialog = SP.UI.ModalDialog.showModalDialog(options);
       }

        function DisplayInfo() 
        {

        var cmlquery="<Query><OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy><QueryOptions><RowLimit>1</RowLimit></QueryOptions><Where><Eq><FieldRef Name='Approved_x003f_' /><Value Type='Choice'>Yes</Value></Eq></Where></Query>";

     $().SPServices({
                operation: "GetListItems",
                async: false,
                listName: "Stories",
                CAMLQuery: cmlquery,
                  CAMLRowLimit: 1,
                completefunc: function (xData, Status) {
                    $(xData.responseXML).SPFilterNode("z:row").each(function () {

                        var story = $(this).attr("ows_Content");
                        var image = $(this).attr("ows_Image");
                        image=image.replace(',','').trim();
                        var html="<img src='"+image+"' border='0'/><br/><br/>"+story+"<br/>Click <a href='#' onclick='OpenDialog()'>here</a> to add your story";
                          $("#teamdata").append(html);
                    });
                }
            });


        }


    $(document).ready(function(){
    DisplayInfo();
    });

     </script>
1

The first line in your JS load script is malformed and not loading JQuery correctly - remove the < symbol in the path. The rest of the code looks like it should run ok.

2
  • Thanks Paul,it was a copy and paste error here.I accidently put the < symbol here.It is not there in the original code.When I replaced the jquery version, it works in IE and FF. But another webpart is throwing error,in firebug it shows ": $(...).tabs is not a function" at the line $("#featured").tabs({ event: "mouseover" }).tabs("rotate", options.slide_speed, true) – sandy Aug 30 '13 at 12:32
  • tabs is a jqueryUI function, is the jqueryui file referenced? – Eric Alexander Aug 30 '13 at 16:34
0

There's a bug in jQuery 1.9.0. There's a line at the end of that version:

//@ sourceMappingURL=jquery.min.map

which causes the error.

If you switch to 1.10.x, you should be fine. Note that there is a different bug in 1.9.1 with the XML handling.

See my blog posts for more info:

http://sympmarc.com/2013/01/29/spservices-compatibility-issues-with-the-minified-version-of-jquery-1-9-0/

http://sympmarc.com/2013/02/05/spservices-compatibility-issues-with-jquery-1-9-1/

Both these issues are highlighted on the SPServices site home page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.