This project has moved and is read-only. For the latest updates, please go here.


The & sign causes problem


Hello and thank's for this great JQuery library for SharePoint Web Services.

I have one small(?) problem, the & sign causes errors.

I have one list with company information, like company name, phone, contact person etc.
The next list contains employees, and of course there's a lookup from the employees list selecting which company the person belongs to.

So i set this up reading the documentation, and it seemed to be working perfect.
But soon i discovered that sometimes it would fail, and i tracked it down to the fact that whenever a company name containes the "&" sign it will fail.
A made up example: "John Doe & Son Furnitures", this will cause an error.

It will cause IE to throw an error, something like this:
"Object required"
"Code 0"
"Row 19"
"Sign 12043"

Firebug in FireFox gives me a "400 Bad Request".

Any ideas?
Is it possible to somehow escape the &-sign before it's posted in the soap envelope?

I used the not minimified version, found "parentSelectSelected = parentSelect.Obj.attr("value");", approx line 699.
Added a new row: parentSelectSelected = parentSelectSelected.replace("&", "&");
And the problem were gone.
Pherhaps there's more chars that needs to be replaced...?
Closed Dec 14, 2009 at 5:33 PM by
Implemented in v0.4.7.


sympmarc wrote Dec 2, 2009 at 12:51 PM

Sounds like a bug. I'll take a look at it and let you know when I have something you can test.

Thanks for reporting it!

sympmarc wrote Dec 2, 2009 at 11:03 PM


Can you please try v0.4.7ALPHA2? It has a fix similar to what you suggested.


lgasoft wrote Dec 4, 2009 at 9:13 AM

Just tried jquery.SPServices-0.4.7ALPHA2.js
Firefox does not throw any errors, but on the other hand, i can't do any filtering/selection, all companys and all employees is returned.

IE gives me (translated) this:
Message: Identifier expected.
Row: 1502
Char: 12
Code: 0
URI: http://[path to javascript library]/jquery.SPServices/jquery.SPServices-0.4.7ALPHA2.js

Thank's for trying to fix it!

sympmarc wrote Dec 4, 2009 at 1:29 PM

Embarrassing. I don't usually post code with that obvious a bug. I'll get back to you asap.


sympmarc wrote Dec 4, 2009 at 8:55 PM

Fixed for real this time. Can you please test when you get a chance?

lgasoft wrote Dec 7, 2009 at 6:41 AM

Just tested jquery.SPServices-0.4.7ALPHA5.js, seems to be working just fine!

lgasoft wrote Dec 7, 2009 at 7:10 AM

Hmm. (jquery.SPServices-0.4.7ALPHA5.js)
No, i was too optimistic.
The filtering worked, but when saving i got this:

[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7469351

And a lot more of cource, do you want that?


sympmarc wrote Dec 7, 2009 at 5:12 PM

Can you share the code and the data that you are using? I'm testing it every which way I can think of and it's working.