|
@@ -30,6 +30,8 @@
|
|
|
<fieldset>
|
|
|
<h2 class="fs-title">基本資料</h2>
|
|
|
<h3 class="fs-subtitle">步驟 1</h3>
|
|
|
+ <input type="text" name='id' value="" style="display: none;" id="userid">
|
|
|
+ <input type="text" name='area' value="" style="display: none;" id="area">
|
|
|
<select name="q1">
|
|
|
<option value="Male">男</option>
|
|
|
<option value="Female">女</option>
|
|
@@ -128,6 +130,8 @@
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
+ <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
|
|
|
+ <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js'></script>
|
|
|
<script>
|
|
|
function showcoffee() {
|
|
|
axios.get('http://q.ptt.cx/coffee').then(res => {
|
|
@@ -139,9 +143,28 @@
|
|
|
});
|
|
|
}
|
|
|
showcoffee();
|
|
|
+
|
|
|
+ function getUserid() {
|
|
|
+ let temparr = document.location.href.split('');
|
|
|
+ let id = temparr[-1];
|
|
|
+ $('#userid').val = id;
|
|
|
+ // console.log(id);
|
|
|
+ }
|
|
|
+ getUserid();
|
|
|
+
|
|
|
+ function getCookie(name) {
|
|
|
+ const value = `; ${document.cookie}`;
|
|
|
+ const parts = value.split(`; ${name}=`);
|
|
|
+ if (parts.length === 2) return parts.pop().split(';').shift();
|
|
|
+ }
|
|
|
+
|
|
|
+ function getArea() {
|
|
|
+ let Area = getCookie(area);
|
|
|
+ $('#area').val = Area;
|
|
|
+ // console.log(Area);
|
|
|
+ }
|
|
|
+ getArea();
|
|
|
</script>
|
|
|
- <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
|
|
|
- <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js'></script>
|
|
|
<script src="./script.js"></script>
|
|
|
</body>
|
|
|
</html>
|