Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 안드로이드
- JavaScript
- FLUTTER
- apache gzip
- release unsigned
- R프로그래밍
- Program type already present
- Java
- DataTable
- Android Apk 이름
- fragment
- spring
- html
- jQuery
- MySQL
- Android
- Android Apk 이름 변경
- error
- Eclipse
- release Apk
- android error
- Firebase
- Android Apk
- Kotlin
- java error
- tomcat
- CSS사용법
- android fragment
- Exception
- css
Archives
- Today
- Total
selfstarter
ajaxForm jquery 예제 본문
ajaxForm jquery 예제
로컬에서는 실행이 되지 않는다. CORS 정책에 의해 차단되었다고 나온다
from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-3.1.1.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script>
$(function(){
$('#form').on('click', function(){
$('#form').attr('action', './test.php').attr('method', 'post').ajaxForm({
beforeSubmit: function(data, form, option) {
console.log('beforeSubmit');
},
uploadProgress : function(event, position, total, percentComplete) {
console.log('uploadProgress');
},
success : function(response, status) {
console.log('success');
},
error : function(req, stat, err) {
console.log('error');
},
}).submit();
});
});
</script>
<style type="text/css">
</style>
</head>
<body>
<form id="form">
Name: <input type="text" name="name" />
Self introduce: <textarea name="introduce"></textarea>
<input type="submit" value="ok" />
</form>
</body>
</html>
'Web > Javascript' 카테고리의 다른 글
JavaScript bind 사용법 (0) | 2020.07.20 |
---|---|
Javascript 다음 년도와 달 구하기 (0) | 2020.06.17 |
Javascript copy paste 복사 붙여넣기 방지 (0) | 2020.06.01 |
javascript escape (0) | 2020.05.28 |
Jquery input 비었는지 체크 (0) | 2020.01.06 |