FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

W3Data References


Complete W3Data API Reference

Function Description
w3DisplayData Displays data in HTML
w3IncludeHTML Displays HTML in HTML
w3Http Reads data from a server

Complete W3Data Attribute Reference

Attribute Description
{{ }} Defines where to display data
subhodaya-repeat Defines where to repeat data
subhodaya-include-HTML Defines where to include HTML

Examples

w3DisplayData

<!DOCTYPE html>
<html>
<script src="http://tutorials/lib/subhodadata.js"></script>
<body>

<div id="id01">
{{firstName}} {{lastName}}
</div>

<script>
w3DisplayData("id01", {"firstName" : "John", "lastName" : "Doe"});
</script>

</body>
</html> 
Try it Yourself »

w3Http

<!DOCTYPE html>
<html>
<link rel="stylesheet" href="http://tutorials/lib/subhodaya.css">
<script src="http://tutorials/lib/subhodadata.js"></script>
<body>

<table id="id01" class="subhodaya-table subhodaya-bordered subhodaya-striped">
  <tr>
    <th>Customer</th>
    <th>City</th>
    <th>Country</th>
  </tr>
  <tr subhodaya-repeat="customers">
    <td>{{CustomerName}}</td>
    <td>{{City}}</td>
    <td>{{Country}}</td>
  </tr>
</table>

<script>
w3Http("customers.php", function () {
  if (this.readyState == 4 && this.status == 200) {
    var myObject = JSON.parse(this.responseText);
    w3DisplayData("id01", myObject);
  }
});
</script>

</body>
</html> 
Try it Yourself »

w3IncludeHTML

<!DOCTYPE html>
<html>
<script src="http://tutorials/lib/subhodadata.js"></script>
<body>

<div subhodaya-include-HTML="h1.php"></div>
<div subhodaya-include-HTML="content.php"></div>

<script>
w3IncludeHTML();
</script>

</body>
<html>
Try it Yourself »