Breaking

for more information click below

PropellerAds

Tuesday, 23 April 2019

W3Data References

Toggle navigation
TUTORIAL HOME
W3Data References
❮ Previous Next ❯
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
w3-repeat Defines where to repeat data
w3-include-HTML Defines where to include HTML
Examples
w3DisplayData
<!DOCTYPE html>
<html>
<script src="https://www.Omegas.com/lib/w3data.js"></script>
<body>

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

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

</body>
</html>
»
w3Http
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="https://www.Omegas.com/w3css/3/w3.css">
<script src="https://www.Omegas.com/lib/w3data.js"></script>
<body>

<table id="id01" class="w3-table w3-bordered w3-striped">
  <tr>
    <th>Customer</th>
    <th>City</th>
    <th>Country</th>
  </tr>
  <tr w3-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>
»
w3IncludeHTML
<!DOCTYPE html>
<html>
<script src="https://www.Omegas.com/lib/w3data.js"></script>
<body>

<div w3-include-HTML="h1.html"></div>
<div w3-include-HTML="content.html"></div>

<script>
w3IncludeHTML();
</script>

</body>
<html>
»

❮ Previous Next ❯

No comments:

Post a Comment

Post Top Ad

PropellerAds