Load external json file problem

Hi,

I just discovered the scheduler for mobile devices.

I’m trying to load events from an external json file.
This is my html file:

<!DOCTYPE html>
<html>
	<head>
		<meta  name = "viewport" content = "initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no">

		<script src="codebase/dhxscheduler_mobile.js" type="text/javascript"> </script>
		<link rel="stylesheet" type="text/css" href="codebase/dhxscheduler_mobile.css">

		<title>Initialization</title>
		<script type="text/javascript" charset="utf-8">
			scheduler.config.init_date = new Date(2011,06,01);
			
			dhx.ready(function(){
		        dhx.ui.fullScreen();
    			dhx.ui({
    			   		view: "scheduler",
					id: "scheduler"
				});
				$$("scheduler").load("stuff.json","json");
			});
		</script>
	</head>
	<body>
	   
	</body>
</html>

I followed the documentation and I managed to load a json using the parse method:

$$("scheduler_id").parse([
	{ id:1, start_date:"2009-7-1 6:00", end_date:"2009-7-1 8:00", text:"Event 1"},
	{ id:2, start_date:"2009-7-2 6:00", end_date:"2009-7-2 8:00", text:"Event 2"}
],"json");

However if I pass the above data to an external file and try to user the load method like in the above html, the data are not loaded. I have the html file and the stuff.json in the same path.

Any ideas why?

Hi,

scheduler.config.init_date is 1st July 2011. And events are added for year 2009. Therefore, you need to navigate to previous dates to see events. I have attached the sample with events for year 2011.
scheduler.zip (64.8 KB)

It still doesn’t work :confused:

I cannot see any events (from the json) if I open the 01_init.html
I also tried adding events with later dates.

Does it work for you as you have it now in the folder you attached?

I can only see events if hardcode the events in the html file, using the parse method.

I attached my files.

thanks for your time.
Archive.zip (74.1 KB)

You are using parse() method, load() is commented. Try to use load().

Locally your sample works fine.

It does not work… I tried it with the load function.

Can you please attach a working example using external json file ?

Be sure to load your sample by [file://some.html](file://some.html) ) - json data will not be loaded correctly.