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

  • Instead of CEWP, Try adding script in Script editor webpart. – SP Developer Sep 21 '16 at 17:02
  • Already tried. But it is still the same. – Mohit Sep 22 '16 at 4:35
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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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