This is a migrated thread and some comments may be shown as answers.

Problem with JSONP data

0 Answers 48 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Matthieu
Top achievements
Rank 1
Matthieu asked on 16 Jul 2012, 05:16 PM
Hy,

i have some troubles by recovering a remote JSON file and my list view.
Here's my code (index.html) :

<ul data-role="listview" data-style="inset" id="selogerlistview"></ul>
 
<script type="text/x-kendo-template" id="listviewseloger">
    <img class="item-leftimg" src="${nom_article}"/>
    <h3 class="item-title"><a>${nom_article}</a></h3>
    <span class="item-bubble">${nom_article}</p>
</script>

And my JS :
function init_seloger() {
            var dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "http://www.mylorraine.fr/api/jsonp_matth.php",
                        dataType: "jsonp",
                        contentType: "application/json; charset=utf-8",
                        type: "GET"
                    }
                },
                error: function(e) {
                   console.log(e);
            },
            schema: {
                data: "categories_article"
            }
            });
                     
        $("#selogerlistview").kendoMobileListView({
            dataSource: dataSource,
            template: $("#listviewseloger").text(),
            endlessScroll: false,
            click: function(e) {     
        }
        });
    }

As a result, i have a parse error :( and a Javascript Syntax error (capture2.jpg)
When i change the JSON file with parenthesis, i have no more Javascrip label error, but a jquery parse error  (capture1.jpg).

Please, someone could help me ?



No answers yet. Maybe you can help?

Tags
ListView (Mobile)
Asked by
Matthieu
Top achievements
Rank 1
Share this question
or