diff options
author | jan <jan@ruken.pw> | 2015-12-30 15:49:59 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2015-12-30 15:49:59 (UTC) |
commit | ee37b31502bc46527a5db51f73459f5f7946e1b2 (patch) | |
tree | e34ae3c9357ed536e1ab589483e999f8bf9d1df2 /assets/js/list.js | |
parent | b203f34144896436db3925c63b3c91bda59f7e77 (diff) |
hover für search-results. beim klicken auf ein gril wird ein request gestartet, fehlt nur noch die implementation, um ein gril zu einer liste hinzuzufügen.
Diffstat (limited to 'assets/js/list.js')
-rw-r--r-- | assets/js/list.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/assets/js/list.js b/assets/js/list.js new file mode 100644 index 0000000..3a58971 --- /dev/null +++ b/assets/js/list.js | |||
@@ -0,0 +1,11 @@ | |||
1 | function clickSearchResult(resId) { | ||
2 | var xhr = new XMLHttpRequest(); | ||
3 | xhr.onreadystatechange = function() { | ||
4 | if (xhr.readyState == XMLHttpRequest.DONE) { | ||
5 | alert(xhr.status + ": " + xhr.response); | ||
6 | } | ||
7 | } | ||
8 | xhr.open('POST', window.location, true); | ||
9 | xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); | ||
10 | xhr.send('id=' + resId); | ||
11 | } \ No newline at end of file | ||