Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Importing Ky Module In JavaScript

<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
 
<script type="module">

	import ky from '/javascripts/test.js';
 
/*Code will run without any window.onload*/

	const json = await ky.post('/test').json();

	console.log(json);
	</script>
	 
	  </head>
  <body>
    <h1><%= title %></h1>
    <p>Welcome to <%= title %></p>
 
  </body>
</html>
 
PREVIOUS NEXT
Tagged: #Importing #Ky #Module #In #JavaScript
ADD COMMENT
Topic
Name
3+2 =