Search

Sound like you are calling a URL without a trailing slash /. Symphony redirects every URL without one to a URL appended with one, thus the 301 redirect.

Unfortunately, I used the slash.

$(document).ready(function(){
$.getJSON("/json",{
},function(data){
    $.each(data.items, function(i,item){
        // console.log(data.item);
    });
});
});

No, you didn't :-)

It needs to be $.getJSON("/json/",..., with the slash at the end of the URL.

Unfortunately still not working.

My json:

{
        "name": 
            { 
                "_attributes" : { "handle": "viscount-980mm" }, 
                "_value" : "Viscount 980mm"
            }
        ,"name": 
            { 
                "_attributes" : { "handle": "viscount-780mm" }, 
                "_value" : "Viscount 780mm"
            }
        ,"name": 
            { 
                "_attributes" : { "handle": "viscount-595mm" }, 
                "_value" : "Viscount 595mm"
            }
}

Everything else I did with the instructions of the first page

Hm, the JSON looks good to me. What exactly is the problem?

I cannot retrieve JSON by using js. I don't know where is problem, everything looks good.

When I try to retrieve JSON the script does not return errors or messages, but the method error () performed on the xhr object is set to true, so something is wrong.

Can you provide a public link?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details