src path only working with full path

Nov 12, 2014 at 8:59 PM
when using the library from a CEWP on sharepoint 2013
I am finding that the src has to have the full path to the file,
I have the library downloaded and in the same library as the jquery file.

I can use the jquery file ok, with a relative url but not the SPServices file

should I be able to ?

thx
Coordinator
Nov 12, 2014 at 9:11 PM
Can you explain more? Do you mean just the src reference in the <script> tag? The SPServices file is no different than any other .js file.

M.
Nov 13, 2014 at 2:48 AM
yes,

i have a root site, with sub sites
in the sub site i have a site assets library where the query and spservices js files are stored.

from a cwep hosted in a page in the subsite
in the src attribute of the script tag i would expect to be able to use /siteassets/spservice...js
however i am finding that i need to use the full url i.e.. http://<parentsite>/<subsite>/siteassets/spservices....js
I thought it odd as i can use the relative path for the jquery file, which is in the same library.

thx
Coordinator
Nov 13, 2014 at 3:51 AM
The relative path should work just fine. I'm not sure what's going on.

M.
Dec 2, 2014 at 9:31 PM
I had this issue too and I stumbled upon this blog that explains some changes from 2010 to 2013: http://www.ashokraja.me/post/Refer-Scripts-and-CSS-Style-Sheet-in-SharePoint-2013-Visual-Web-Part-and-Master-Page.aspx

See the Javscript section.