Get started with sco.js CDN

Apache-2.0 licensed

Sco.js is a lightweight library for creating interactive data visualizations.

Tags:
  • scojs
  • sco.js
  • twitter
  • bootstrap
  • twitter-bootstrap

Stable version

Copied!

How to start using sco.js CDN


<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://cdn.cdnhub.io/sco.js/1.0.2/css/scojs.min.css">
  <title>Get started with sco.js CDN - cdnhub.io</title>
</head>
<body>
  <form id="myForm">
    <label for="name">Name:</label>
    <input type="text" id="name" name="name" required>
    <label for="email">Email:</label>
    <input type="email" id="email" name="email" required>
    <button type="submit">Submit</button>
  </form>
  <script src="https://cdn.cdnhub.io/sco.js/1.0.2/sco.min.js"></script>
  <script>
    const form = document.querySelector('#myForm');
    SCO.configure({
      rules: [
        {
          target: '#name',
          message: 'Please enter a valid name.',
          test: (value) => {
            return /^[a-zA-Z\s]+$/.test(value);
          },
        },
        {
          target: '#email',
          message: 'Please enter a valid email address.',
          test: (value) => {
            return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
          },
        },
      ],
    });

    SCO.form(form);
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions