回答編集履歴

4

調整

2021/11/22 07:46

投稿

yambejp
yambejp

スコア116060

test CHANGED
@@ -20,7 +20,11 @@
20
20
 
21
21
  $("#download-image").click(function() {
22
22
 
23
+ var a=$('<a>');
24
+
23
- $('<a>').attr({'href':$("#canvas").jSignature("getData"),download:"test.png"}).appendTo($('body')).end().get(0).click();
25
+ a.attr({'href':$("#canvas").jSignature("getData"),download:"test.png"}).appendTo($('body')).end().get(0).click();
26
+
27
+ a.remove();
24
28
 
25
29
  });
26
30
 

3

chouseo

2021/11/22 07:46

投稿

yambejp
yambejp

スコア116060

test CHANGED
@@ -1 +1,41 @@
1
- 回答場所を間違えました
1
+ ```javascript
2
+
3
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
4
+
5
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jSignature/2.1.3/jSignature.min.js"></script>
6
+
7
+ <script>
8
+
9
+ $(function(){
10
+
11
+ $("#canvas").jSignature();
12
+
13
+ $("#clear").click(function() {
14
+
15
+ $("#canvas").jSignature("reset");
16
+
17
+ $("img").remove();
18
+
19
+ });
20
+
21
+ $("#download-image").click(function() {
22
+
23
+ $('<a>').attr({'href':$("#canvas").jSignature("getData"),download:"test.png"}).appendTo($('body')).end().get(0).click();
24
+
25
+ });
26
+
27
+ });
28
+
29
+ </script>
30
+
31
+ <div id="canvas" style="background-color:#ffffee;"></div>
32
+
33
+ <button id="clear">クリア</button>
34
+
35
+ <button id="download-image">画像ダウンロード</button>
36
+
37
+ <div id="someelement"></div>
38
+
39
+
40
+
41
+ ```

2

調整

2021/11/22 07:42

投稿

yambejp
yambejp

スコア116060

test CHANGED
@@ -1 +1 @@
1
- すみません、回答場所を間違えました
1
+ 回答場所を間違えました

1

修正

2021/11/22 07:35

投稿

yambejp
yambejp

スコア116060

test CHANGED
@@ -1,35 +1 @@
1
- ```PHP
2
-
3
- function unicode_decode($str) {
4
-
5
- return preg_replace_callback("/((?:[^\x09\x0A\x0D\x20-\x7E]{3})+)/",function ($matches) {
6
-
7
- $char = mb_convert_encoding($matches[1], "UTF-16", "UTF-8");
8
-
9
- $escaped = "";
10
-
11
- for ($i = 0, $l = strlen($char); $i < $l; $i += 2) {
12
-
13
- $escaped .= "\u" . sprintf("%02x%02x", ord($char[$i]), ord($char[$i+1]));
14
-
15
- }
16
-
17
- return $escaped;
1
+ すみません、回答場所を間違えました
18
-
19
- },$str);
20
-
21
- }
22
-
23
- $str = "αβγδεζηθικλμνξοπρστυφχψω";
24
-
25
- $decoded = unicode_decode($str);
26
-
27
- echo "$decoded\n";
28
-
29
-
30
-
31
- // \u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9
32
-
33
-
34
-
35
- ```