-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
122 lines (89 loc) · 3.79 KB
/
index.html
File metadata and controls
122 lines (89 loc) · 3.79 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>LVM Code - Professor Seeger</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<style>
#LVM_result {
width=850px;
}
</style>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="js/jquery.ajax-cross-origin.min.js"></script>
<script>
$(document).ready(function() {
//get the URL. If it include an RID then just load that code, otherwise load the lvmcode page.
x = window.location.href;
y = x.split("?"); //splts the parameters off the URL so we can test to see if there are parameters
if (y.length > 1) {
//document.getElementById("LVM_result").innerHTML =y[1];
params = y[1]; //this is just the parameters
paramArray = params.split("&") //split the parameters on &
ridParamString = paramArray[0];
typeParamString = paramArray[1];
ridParam = ridParamString.split("=");
typeParam = typeParamString.split("=");
rid = parseInt(ridParam[1], 10);
type = typeParam[1];
//Add in error detection for the type
//AJAX Call to update count
$.post("https://indicator.extension.iastate.edu/projects/tasksheets/lvmCodeCounter.php", {
rid: rid,
type: type
});
/*
$.post("https://indicator.extension.iastate.edu/projects/tasksheets/lvmCodeRedirect.php", {
rid: rid,
type: type
},
//crossOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*'
},
function(data, status) {
document.getElementById("LVM_result").innerHTML = status + " -hello";
}
);
*/
$.ajax({
type: 'POST',
// make sure you respect the same origin policy with this url:
url: 'https://indicator.extension.iastate.edu/projects/tasksheets/lvmCodeRedirect.php',
crossOrigin: true,
data: {
rid: rid,
type: type
},
success: function(msg){
alert('response is' + msg);
}
});
/*
$.ajax({
crossOrigin: true,
url: url,
` `success: function(data) {
console.log(data);
}
});
*/
//pass code to new page and replace this page
// window.location.href = "https://indicator.extension.iastate.edu/projects/tasksheets/lvmCodeRedirect.php?rid="+rid+"&type="+type;
} else {
// $('body').appe
$("#LVM_result").load("https://indicator.extension.iastate.edu/projects/tasksheets/lvmCode.php");
}
})
</script>
</head>
<body>
<h2>L<span class="greenText">earning</span> V<span class="greenText">isual and </span>M<span class="greenText">apping Code</span></h2>
<h3>Code Examples by Professor Christopher J. Seeger, GISP</h3>
<br>
<div id="LVM_result">--</div>
</body>
</html>