This is a simple example of using ajax to fetch content and add it to the page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| in src/routes/auth.cr:22: instantiating 'JWT:Module#encode(Hash(String, String | Nil), String, JWT::Algorithm)' | |
api_1 | | |
api_1 | jwt = JWT.encode(payload, "SecretKey", JWT::Algorithm::HS256) | |
api_1 | ^~~~~~ | |
api_1 | | |
api_1 | in lib/jwt/src/jwt.cr:25: instantiating 'encoded_signature(JWT::Algorithm, String, String)' | |
api_1 | | |
api_1 | segments << encoded_signature(algorithm, key, segments.join(".")) | |
api_1 | ^~~~~~~~~~~~~~~~~ | |
api_1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const component = ({ | |
children, | |
title | |
}) => { | |
const body, head | |
return ( | |
<html> | |
<head ref={el => head = el} /> | |
<body ref={el => body = el} /> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title></title> | |
<link href='http://fonts.googleapis.com/css?family=EB+Garamond' rel='stylesheet' type='text/css'> | |
<link href='style.css' rel='stylesheet' type='text/css'> | |
</head> | |
<body> | |
<img src="body_image1.jpg" alt="Alchemical Symbol"> | |
<header><h1>Of the Heavens and their Influence.</h1></header> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article> | |
<h1>Example One: An article loaded on click</h1> | |
<div class="content"> | |
<p> | |
This is an article whose contents exist at article-one.html. | |
We are listening for the 'click' event on menu items and using | |
ajax to fetch the content when it fires.</p> | |
</div> | |
</article> |