ie8 and script errors

Feb 1, 2013 at 11:26 PM
Please bear with me as I'm very new to sharepoint, jquery, and spservices. I am using the script below for cascade drop down and have found that it works fine in ie9 but throws errors in ie8.

Looking under f12 in ie9, it looks like errors occur there too but I guess they are just ignored. Does anybody have any suggestions on how to fix or make this work with ie8?

The error:
SCRIPT5022: Syntax error, unrecognized expression: unsupported pseudo: child 
jquery.min.js, line 2 character 59313
SCRIPT32811: Element not found.
 
init.js?rev=yOq8IoAABYCtaZjMVrjxtg%3D%3D, line 1946 character 4
The script:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="/_LAYOUTS/1033/SCRIPTS/spservices/jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({ 
    relationshipList: "Employees",
    relationshipListParentColumn: "Title",
    relationshipListChildColumn: "DepartmentName",
    parentColumn: "Employee",
    childColumn: "Department",
        selectSingleOption:true
});

});
</script>
Thanks!
Chris
Coordinator
Feb 3, 2013 at 5:21 PM
Try setting debug: true in SPCascadingDropdowns. I'm guessing you may have a column name issue.

M.
Feb 3, 2013 at 7:08 PM
I tried that but am getting the same errors. If it was a column name issue, wouldn't that cause it to work in ie9 either?

Here is the modified script. Please let me know if you see anything wrong.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="/_LAYOUTS/1033/SCRIPTS/spservices/jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({ 
    relationshipList: "Employees",
    relationshipListParentColumn: "Title",
    relationshipListChildColumn: "DepartmentName",
    parentColumn: "Employee",
    childColumn: "Department",
    selectSingleOption: true,
    debug:true
});

});
</script>
Coordinator
Feb 4, 2013 at 4:44 AM
I can't spot anything.

Try removing selectSingleOption. also, look at the network traffic to see if there is anything about the data coming back that looks off.

M.
Feb 4, 2013 at 6:52 AM
I removed selectSingleOption but still get the same error. FWIW, removing that option removed the select but filter was still correct. I'm not sure how to look at network traffic to see if data looks off, but the filtering seems to be correct. Despite these errors, the script functions correctly in IE9, but the "newform" won't load correctly in IE8. It basically locks up with "errors with script on this page".

I did some digging and 'SCRIPT32811: Element not found' is happening on other pages on the site. Quick google shows it may be a problem with my machine so I don't think that's actually related


The error looks to me like it's having a problem with the jQuery itself.

I removed Cascadedropdowns and changed code to what is below and still get the error: SCRIPT5022: Syntax error, unrecognized expression: unsupported pseudo: child
jquery.min.js, line 2 character 59313

However, the popup shows my site correctly

I tried different versions on the hosted site as well as saving and referencing the script locally and nothing seems to help.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="/_LAYOUTS/1033/SCRIPTS/spservices/jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
alert($().SPServices.SPGetCurrentSite());

});
</script>
I am trying to research the SCRIPT5022 but not getting very far. Thanks for you suggestions and your time. If you or anyone else has any more input, I'd love to hear it!

Someone please help me write a script to give end users patience :)
Feb 4, 2013 at 3:14 PM
I resolved the SCRIPT32811 error by doing an office repair as suggested here:

http://hassanmia.blogspot.com/2011/02/sharepoint-element-not-found.html

I changed script to be just an JQuery alert and am still getting the SCRIPT5022. Can anyone suggest where to start for getting assistance with jQuery?

Thanks,
Chris
Coordinator
Feb 4, 2013 at 3:32 PM
jQuery ought to be fine. Is that all you are loading at this point? What version of SharePoint?

M.
Feb 4, 2013 at 3:34 PM
Code above is all I'm loading. Sharepoint 2007 Enterprise.
Coordinator
Feb 4, 2013 at 3:39 PM
And what's the full text of the error?

M.
Feb 4, 2013 at 3:48 PM
In IE9 - The script "works", but Error below is what shows when I do f12
In IE8 - My newform page "locks up" and eventually I get an error that says a script on the page failed to load, "click here for details" and that page shows the same error as below.

If there is a way to get more details that might help, just let me know. Thanks again for taking the time.
Line: 2
Error: Syntax error, unrecognized expression: unsupported pseudo: child
jquery-1.8.3.min.js, line 2 character 59313
Coordinator
Feb 4, 2013 at 3:50 PM
Have you tried any other versions of jQuery? It might make sense to try something like 1.7 just to see if you get the same error.

M.
Feb 4, 2013 at 7:13 PM
Marc,

We found the problem. This is an "inherited" environment with a lot of custom pages and non-existent documentation. We found where page had been edited and some other jQuery added. Removing this solved our problem.

I apologize for wasting your time.

Thank You for your help
Chris
Coordinator
Feb 4, 2013 at 7:27 PM
No worries, Chris. Glad you figured it out.

M.