Everlive returning "undefined" instead of data

4 posts, 0 answers
  1. Adrian
    Adrian avatar
    6 posts
    Member since:
    Dec 2013

    Posted 02 Apr 2014 Link to this post

    Hi,

    I am new to the telerik platform. At the minute I have started my mobile application in a Jquery mobile app template in telerik app builder. I have created my backend service and I am now trying to pull from it with the code below
    <script>  
    var b = document.getElementById("breakfastCont");    
    var el = new Everlive("5ZzBykWYT3Xf9mFF");
    var myHtml;  
    el.data(
    "TestRecipe").getById("f661ec20-ba41-11e3-b338-d3e0f19c8d17", function (data) {
     myHtml = data.result.RECIPE;      
    b.innerHTML = myHtml;
    }, 
    function (err) {
     console.log(JSON.stringify(err));
    })
    </script> 

    But it only returns "undefined" instead of the text in that field???
  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 02 Apr 2014 Link to this post

    Hello Adrian,

    Could you please check with the following code (only the name of the field "RECIPE" is changed to "Recipe"):

    var el = new Everlive("5ZzBykWYT3Xf9mFF");\
     
    var myHtml;
    el.data("TestRecipe").getById("f661ec20-ba41-11e3-b338-d3e0f19c8d17", function (data) {
        myHtml = data.result.Recipe;
        b.innerHTML = myHtml;
    }, function (err) {
        console.log(JSON.stringify(err));
    })

    Please, let us know if you have further questions.

    Regards,
    Anton Dobrev
    Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
  3. Adrian
    Adrian avatar
    6 posts
    Member since:
    Dec 2013

    Posted 02 Apr 2014 in reply to Anton Dobrev Link to this post

    Hi Anton, Thanks for the reply.

    Unfortunately that did not fix the problem. The content type in my Backend is called "TestRecipe" and the item with the id I am trying to pull has a name of "RECIPE", not "Recipe". When i change it to lower case it displays nothing at all

    Anything else it could be?
  4. Adrian
    Adrian avatar
    6 posts
    Member since:
    Dec 2013

    Posted 02 Apr 2014 in reply to Adrian Link to this post

    Hi Anton,

    Sorry for confusion. The above change worked.

    Thanks,
    Adrian
Back to Top