Page 1 of 1

SPServices only working for Site Collection Administrator

Posted: 05 Sep 2014
by olavur
Hello,

I use SPService like this:

window.$().SPServices({

..some code

});

It works fine as long as I am site collection administrator. I have included this in the masterpage where I use jquery 1.11.1.min.js:

<script src="/_catalogs/masterpage/jquery-1.11.1.min.js"></script>

<script src="/_catalogs/masterpage/jquery.spservices-2014.01.min.js"></script>

I have figured out, that when I am NOT site collection administrator this is incloded in the source code (This is NOT included when I am NOT administrator):

<link rel="stylesheet" type="text/css" href="/style%20library/FormsDesigner/jquery-ui-1.10.3.custom.min.css?rev=2_8_1"/>

<link rel="stylesheet" type="text/css" href="/style%20library/FormsDesigner/Form.css?rev=2_8_3"/>

<script src="/style%20library/formsdesigner/jquery/jquery-1.10.2.min.js"></script>

<script src="/style%20library/formsdesigner/jquery/jquery-ui-1.10.3.custom.min.js"></script>

<script src="/style%20library/formsdesigner/jquery/jquery.cookie.js"></script>

<script src="/style%20library/FormsDesigner/form.min.js?rev=2_8_6"></script>

So when I am administrator I can test thw window.$() in the debugger consol of the browser but when I am NOT administrator the debugger does not find the $() function.

Any ideas why this is happening?

Could it be that the $() function is not included in the jquery-ui-1.10.3.custom.min.js?

How do I then make SPForm use jquery 1.11.1?

Thanks

Olavur

Re: SPServices only working for Site Collection Administrator

Posted: 06 Sep 2014
by Dmitry Kozlov
Hello Olavur,

Please, make sure that the files jquery-1.11.1.min.js and jquery.spservices-2014.01.min.js are loaded for non administrators. Probably, you should approve them or put into another library e.g. Style Library and provide users with read permission.

Re: SPServices only working for Site Collection Administrator

Posted: 08 Sep 2014
by olavur
I moved jquery and spservices to the Style Library and modified the link on my master page to load from the Style Library.

Now everything works fine :)

Thanks