HTML5 Data Bindings Support Product Page
In progress
HTML5 Data Bindings Not Displaying JSON data
Reported 10 years ago
7
have this problem
10 years ago Glenn Williams posted:
Hi, I am trying to us the html5 data bindings to display data from a json document but cannot get any data to display in live view.I have validated my json file and it checks out as valid.
when I try using the repeat region I just see a white page and when I try non-repeated elements I either see - NaN, a white page or the actual code.
I have verified that all scripts are uploaded so I feel like I'm missing something simple.
my os is mac yosemite and dreamweaver cc. Below is some of the code I have tried with no luck.
<script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataBindings.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataSet.js"></script>
<script type="text/javascript">
/* dmxDataSet name "transactions-data" */
jQuery.dmxDataSet(
{"id": "transactions-data", "url": "data.json", "data": "", "dataSourceType": "local", "dataType": "json"}
);
/* END dmxDataSet name "transactions-data" */
</script>
<body>
{{transactions-data.TotalResults}}
</body>
thanks in advance
Replies
Replied 10 years ago
10 years ago Dave Smith replied:
Shot in the dark....
Try removing any hyphens used in data sources, aliases, columns Etc..
Try removing any hyphens used in data sources, aliases, columns Etc..
Replied 10 years ago
10 years ago Teodor Kuduschiev replied:
Hi Glenn,
As Dave suggests - the problem is with the "-" in the datasource name please use an underscore "_" instead.
As Dave suggests - the problem is with the "-" in the datasource name please use an underscore "_" instead.
Replied 9 years ago
9 years ago Colin Miller replied:
I have this problem too. Using OSX Yosemite, Dreamweaver CC 2015.
I have checked that all the scripts in ScriptLibrary have been copied into the directory correctly. There is also an empty 'dmxDatabaseSources' folder which the extension has created, along with an empty 'Styles' one. I have checked that the json is valid, which it is.
When I run the page in the browser it just returns the tag {{monthname}}
Here is my code...
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataBindings.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataSet.js"></script>
<script type="text/javascript">
/* dmxDataSet name "dec" */
jQuery.dmxDataSet(
{"id": "dec", "url": "december.json", "data": "", "dataSourceType": "local", "dataType": "json"}
);
/* END dmxDataSet name "dec" */
</script>
</head>
<body>
<div data-binding-id="repeat1" data-binding-repeat-children="{{dec}}">{{monthname}}</div>
</body>
</html>
I have checked that all the scripts in ScriptLibrary have been copied into the directory correctly. There is also an empty 'dmxDatabaseSources' folder which the extension has created, along with an empty 'Styles' one. I have checked that the json is valid, which it is.
When I run the page in the browser it just returns the tag {{monthname}}
Here is my code...
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataBindings.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataSet.js"></script>
<script type="text/javascript">
/* dmxDataSet name "dec" */
jQuery.dmxDataSet(
{"id": "dec", "url": "december.json", "data": "", "dataSourceType": "local", "dataType": "json"}
);
/* END dmxDataSet name "dec" */
</script>
</head>
<body>
<div data-binding-id="repeat1" data-binding-repeat-children="{{dec}}">{{monthname}}</div>
</body>
</html>
Replied 9 years ago
9 years ago Teodor Kuduschiev replied:
Hi Colin,
Please provide a link to your page, where we can check this.
Please provide a link to your page, where we can check this.
Replied 9 years ago
9 years ago Conor lawlor replied:
I am having the same problem too. I have been banging my head against a wall for a couple of days now. PLeae, Teodor, put me out of my misery!
Here is a sample page: whytes.ie/html5test.html
And the code
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript">
/* dmxServerAction name "HTMLtestExecutor" */
jQuery.dmxServerAction(
{"id": "HTMLtestExecutor", "url": "dmxConnect/api/NewTest.asp", "method": "GET", "sendOnSubmit": false, "sendOnReady": true, "data": {}}
);
/* END dmxServerAction name "HTMLtestExecutor" */
</script><title>Untitled Document</title>
<script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataBindings.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataSet.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxServerAction.js"></script>
</head>
<body>
<div data-binding-id="repeat1" data-binding-repeat="{{HTMLtestExecutor.data.queryHTMLtest}}">{{AUCTION}}{{IMAGE}}</div>
<div data-binding-id="repeat2" data-binding-repeat="{{HTMLtestExecutor.data.queryArtists}}">{{FIRSTNAME}}{{LITERATURE}}</div>
</body>
</html>
Here is a sample page: whytes.ie/html5test.html
And the code
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript">
/* dmxServerAction name "HTMLtestExecutor" */
jQuery.dmxServerAction(
{"id": "HTMLtestExecutor", "url": "dmxConnect/api/NewTest.asp", "method": "GET", "sendOnSubmit": false, "sendOnReady": true, "data": {}}
);
/* END dmxServerAction name "HTMLtestExecutor" */
</script><title>Untitled Document</title>
<script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataBindings.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataSet.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxServerAction.js"></script>
</head>
<body>
<div data-binding-id="repeat1" data-binding-repeat="{{HTMLtestExecutor.data.queryHTMLtest}}">{{AUCTION}}{{IMAGE}}</div>
<div data-binding-id="repeat2" data-binding-repeat="{{HTMLtestExecutor.data.queryArtists}}">{{FIRSTNAME}}{{LITERATURE}}</div>
</body>
</html>
Replied 9 years ago
9 years ago George Petrov replied:
Hi Conor,
Somehow the script block containing dmxServerAction is way above all other includes in your head. It should be placed actually before the body end tag. So move the whole block just before </body>
-George
Somehow the script block containing dmxServerAction is way above all other includes in your head. It should be placed actually before the body end tag. So move the whole block just before </body>
-George
Replied 9 years ago
9 years ago Conor lawlor replied:
Thanks for the response, George, but I'm afraid it didn't solve the problem. I have two pages, both with the same problem. I implemented your change, and still no joy.
whytes.ie/html5test.html
theoriel.com/expert/artists.html
Could you post a simple page with working code, so I could at least have a target to aim for?
whytes.ie/html5test.html
theoriel.com/expert/artists.html
Could you post a simple page with working code, so I could at least have a target to aim for?
Replied 9 years ago
9 years ago George Petrov replied:
Hi Conor,
I see you are running Server Connect on ASP server - we have some issues there with the new global debug flag we introduced in the last update. So a new update will be released very quickly now on Monday/Tuesday to fix this.
-George
I see you are running Server Connect on ASP server - we have some issues there with the new global debug flag we introduced in the last update. So a new update will be released very quickly now on Monday/Tuesday to fix this.
-George
Replied 9 years ago
9 years ago Conor lawlor replied:
George
I feel bad that you are replying on a Sunday! Take the rest of the day off:-)
I look forward to the update.
Conor
I feel bad that you are replying on a Sunday! Take the rest of the day off:-)
I look forward to the update.
Conor