How to get remote url json? I even tested the access-control via test-cors.org
quality4u

I am very new to WADE and I really am excited to get going with my first app. I need to grab some json from a website that I own.

No matter what I do I get this error:

Warning trying to get json file with out loading it first.

Also, how do I clear the app logs? 
Are there any shortcut keys for running the app?

 

Here is my code:

App = function()
{
    // this is where the WADE app is initialized
	this.init = function()
	{
	     
	    wade.loadJson('https://pubzen.com/books/bears/bears.json');
        this.book =wade.getJson('https://pubzen.com/books/bears/bears.json');
            
             this.bookText=this.book.data;
	     
	     for ( var i in this.bookText) {
            	var id = this.bookText[i];
            	
            	
            	    //console.log(id);
            	    for (var j in id){
            	      var word = id[j];
            	      console.log(word);
            	    }
            	
	 
	     }
       
        // load a scene
		wade.loadScene('scene1.wsc', true, function()
        {
            
            
            

        });
	};
};

 

All 5 Comments
quality4u

Also, I'm willing to hire someone to build out an app for me. It is basically an app for my daughter to be able to touch words and hear them enabling her to read a book. I already have an example of the app coded in regular jquery & html.

Gio

Hi and welcome

Seeing as you're loading a scene, I would recommend  just adding the json file to that scene, rather than loading it explicitly in code.

If you do it this way, after loading the scene you can access your json data directly from wade.app.book

 

quality4u

Gio, that worked perfectly. Do you know of anyone who would like to develop a simple reading app for me using WADE so that I could make small modifications later?

Gio

I can think of a couple of people that are often on this forum and who might be able to help depending on their schedule.

To be sure that they know about it, I'd create another thread where you make it obvious in the title that you want to hire someone to make a wade app.

quality4u

Just wanted to update this to show how I got the json feed to work via code. The key is to preload the json file inside of a this.load = function()
    { } statement. 

App = function()
{
	this.load = function()
	{
    wade.loadJson('https://pubzen.com/books/bears/bears.json');
    wade.loadAudio('audio/miracle.ogg');

    }

    // this is where the WADE app is initialized
	this.init = function()
	{
	     
	
        this.book =wade.getJson('https://pubzen.com/books/bears/bears.json');
            
        this.bookText=this.book.data;

 

Post a reply
Add Attachment
Submit Reply
Login to Reply