-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
46 lines (43 loc) · 1.37 KB
/
Copy pathindex.html
File metadata and controls
46 lines (43 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
<title>Microsoft Cognitive Services - Computer Vision API</title>
<link rel="stylesheet" type="text/css" href="/css/styles.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<div class="container">
<h1>AI SUMMIT AZURE DEMO</h1>
<form action="/search" id="form">
<div>
<label for="imageURL">Enter image URL:</label>
<input type="text" name="imageURL" id="imageURL" required />
</div>
<div>
<input type="submit" value="Analyze Image"/>
</div>
<div>
<p id="response"></p>
</div>
</form>
</div>
<script>
$( "#form" ).submit(function( event ) {
event.preventDefault();
$('#response').empty().append("Analyzing...")
$.ajax({
url: '/search',
type: 'POST',
data: { imageURL: document.querySelector("#imageURL").value },
success: function(data){
console.log(data)
$('#response').empty().append(data.response)
}
, error: function(jqXHR, textStatus, err){
alert('text status '+textStatus+', err '+err)
}
})
});
</script>
</body>
</html>