0

I am using SPservices cascading dropdown as mentioned below in Sharepoint 2013. This works fine when I enter the code SharePoint designer asp content head section. But it fails when I try to add the same code in content editor on the list form page. Below is the code:

<script type="text/javascript">
$(document).ready(function(){
    $().SPServices.SPCascadeDropdowns({
        relationshipList: "States",
        relationshipListParentColumn: "Country",
        relationshipListChildColumn: "Title",
        parentColumn: "Country",
        childColumn: "State",
        debug: true
    })
})
</script>

When I am adding it to content editor it throws following error:

jquery-3.1.0.min.js:4 XMLHttpRequest cannot load http://_vti_bin/Lists.asmx. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

So my question is: Can I do it in Content editor or not? If not, why and if yes, how.

EDIT Got the mentioned error in chrome, in IE there is no error but the child drop-down does not work.

Edit2

Noticed another strange thing. My application is hosted on port number 1494, but in error it is showing 14941494(twice). Re-posting the error below:

XMLHttpRequest cannot load http://MyWeb:14941494/_vti_bin/Lists.asmx. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.send @ jquery-3.1.0.min.js:4

2
  • Instead of CEWP, Try adding script in Script editor webpart. Commented Sep 21, 2016 at 17:02
  • Already tried. But it is still the same.
    – Mohit
    Commented Sep 22, 2016 at 4:35

1 Answer 1

0

You were discreet enough to avoid publishing your server url origin [ :') ] so I can't know for sure.

But the fact that it works when you put it on the ASP content head and not on the content editor webpart makes me think that you probably have to setup an alternate access mapping / host header for the web app (that is if your application is on another port than 80 or 443).

2
  • Yes. My application is hosted on 1494 port. But could you please point me to the right direction. Also i have edited my question with another strange thing i noticed
    – Mohit
    Commented Sep 22, 2016 at 4:37
  • Ou yeah! This 14941494 gibberish looks like you hit a jackpot to me! Definitely seems to be a host header issue. Look at this question: sharepoint.stackexchange.com/questions/153499/… and for directions thuansoldier.net/?p=1323 Commented Sep 23, 2016 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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