Plain JavaScript
Basic Example with HTML/CSS/JS
This contrived example demonstrates how to show a simple recommendation using the UMD version of the library.
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="index.css">
<script src="https://cdn.obviyo.net/lib/obv-api.js"></script>
</head>
<body>
<h4>Headless Recommendations</h4>
<p>Using standard JavaScript</p>
<script src="index.js"></script>
</body>body {
font-family: Arial, Helvetica, sans-serif;
}
.item {
border: 1px solid #ccc;
padding: 0 10px;
margin: 5px;
width: 200px;
height: 300px;
display: inline-block;
vertical-align: top;
}
.item>a {
text-decoration: none;
}
.item>a>img {
width: 100%;
max-width: 200px;
}
Last updated
Was this helpful?