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

Everlive returning "undefined" instead of data

3 Answers 94 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adrian
Top achievements
Rank 1
Adrian asked on 02 Apr 2014, 09:31 AM
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???

3 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 02 Apr 2014, 10:13 AM
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.
 
0
Adrian
Top achievements
Rank 1
answered on 02 Apr 2014, 12:02 PM
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?
0
Adrian
Top achievements
Rank 1
answered on 02 Apr 2014, 12:13 PM
Hi Anton,

Sorry for confusion. The above change worked.

Thanks,
Adrian
Tags
General Discussion
Asked by
Adrian
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Adrian
Top achievements
Rank 1
Share this question
or