Skip to content

Instantly share code, notes, and snippets.

@jeanmachuca
Created November 8, 2020 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeanmachuca/a7e754ac2c655990111e86e7f05e1fd5 to your computer and use it in GitHub Desktop.
Save jeanmachuca/a7e754ac2c655990111e86e7f05e1fd5 to your computer and use it in GitHub Desktop.
Hello World with QCObjects (Dynamic Inline Component Injection)
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
<title>QCObjects Hello World</title>
<script type="text/javascript" src="https://qcobjects.dev/QCObjects.js"></script>
</head>
<body>
<script type="text/javascript">
Ready(()=>{
document.body.append(New(Component,{
name:"hello-world",
tplsource:"inline",
template:"Hello World",
body:_DOMCreateElement("hello-world")
}));
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment