allintitle:uploadbutton html
1<!doctype html>
2<html>
3 <head>
4 <meta charset="utf-8" />
5 <title>Upload Button Examples</title>
6 <link rel="stylesheet" href="../themes/default/default.css" />
7 <script src="../kindeditor-min.js"></script>
8 <script>
9 KindEditor.ready(function(K) {
10 var uploadbutton = K.uploadbutton({
11 button : K('#uploadButton')[0],
12 fieldName : 'imgFile',
13 url : '../php/upload_json.php?dir=file',
14 afterUpload : function(data) {
15 if (data.error === 0) {
16 var url = K.formatUrl(data.url, 'absolute');
17 K('#url').val(url);
18 } else {
19 alert(data.message);
20 }
21 },
22 afterError : function(str) {
23 alert('???????: ' + str);
24 }
25 });
26 uploadbutton.fileBox.change(function(e) {
27 uploadbutton.submit();
28 });
29 });
30 </script>
31 </head>
32 <body>
33 <div class="upload">
34 <input class="ke-input-text" type="text" id="url" value="" readonly="readonly" /> <input type="button" id="uploadButton" value="Upload" />
35 </div>
36 </body>
37</html>
Are there any code examples left?
New code examples in category Html
-
Html 2022-03-27 21:55:05 how to kill html
-
Html 2022-03-27 21:55:02 How to create web urls without extensions
-
Html 2022-03-27 21:45:11 space between 2 h tags without break
-
Html 2022-03-27 21:40:13 how to resize submit button in html
-
Html 2022-03-27 20:40:18 https://www.codegrepper.com
-
Html 2022-03-27 19:55:09 show image inside table with innerhtml
-
Html 2022-03-27 19:30:47 html email input
-
Html 2022-03-27 18:45:01 how to add favicon in html
-
Html 2022-03-27 18:15:21 picture html
-
Html 2022-03-27 18:15:11 ex: javaasdasdasdasd