여기 여기에 내가 ....이 주위에 확인 예/아니오 대화 상자를 추가 한 아이디어이 코드에 대한 의견을 추가 하시겠습니까?
0
A
답변
3
사용 window.confirm()
어떻게 내 HTML
<span class="delete"><a rel="<?php print $step['step_number']; ?>" class="delete_step" href="#">Delete Step</a></span>
내 JQuery와
$('.delete_step').live('click', function(e) {
e.preventDefault();
var delete_location = window.location.pathname.replace('admin/', '') + '?route=module/cart/delete_step';
$.post(delete_location, { step_id: $(this).attr("rel"), template_number: "<?php print $template_id; ?>" },
function(result) {
var token = window.location.search.match(/token=(\w+)/)[1];
window.location.href = window.location.pathname + '/index.php?route=system/template&token=' + token;
});
});
입니다. 이 같은
$('.delete_step').live('click', function(e) {
e.preventDefault();
if (confirm('Are you sure?')) {
// do the $.post()
}
}
1
뭔가 (테스트되지 않음)
$('.delete_step').live('click', function(e) {
e.preventDefault();
var answer = confirm("Are you sure?")
if (answer){
var delete_location = window.location.pathname.replace('admin/', '') + '?route=module/cart/delete_step';
$.post(delete_location, { step_id: $(this).attr("rel"), template_number: "<?php print $template_id; ?>" },
function(result) {
var token = window.location.search.match(/token=(\w+)/)[1];
window.location.href = window.location.pathname + '/index.php?route=system/template&token=' + token;
});
}else{
alert('fail!');
}
});
0
이이 기능을 계속하기 전에 요청합니다 :
1
$('.delete_step').live('click', function(e) { e.preventDefault(); if(confirm("Message to be popped up?")) { var delete_location = window.location.pathname.replace('admin/', '') + '?route=module/cart/delete_step'; $.post(delete_location, { step_id: $(this).attr("rel"), template_number: "" }, function(result) { var token = window.location.search.match(/token=(\w+)/)[1]; window.location.href = window.location.pathname + '/index.php?route=system/template&token=' + token; }); } });
관련 문제
- 1. 과거 코드에 대한 의견을 남기고 있습니까?
- 2. xaml 코드에 이미지 추가 하시겠습니까?
- 3. 이 코드에 대한 설명이 필요 - #
- 4. 이 CSS 코드에 대한 설명
- 5. 이 코드에 대한 Google지도 사용자 정의 마커
- 6. 이 코드에 대한 도움말 (STATUS_ACCESS_VIOLATION 제공)
- 7. 이 mysql 코드에 대한 약간의 설명
- 8. 이 Java 코드에 대한 설명은 무엇입니까?
- 9. 이 코드에 대한 혼란 스러워요 C
- 10. HRESULT 코드에 대한 진단 메시지를 생성 하시겠습니까?
- 11. 이 코드에 문제가 있습니까?
- 12. 이 템플릿 디자인 아이디어에 대한 의견을 듣고 싶습니다.
- 13. 이 코드에 누수가 있습니까?
- 14. 이 코드에 문제가 있습니까?
- 15. 코드에 클래스 설명 추가?
- 16. 내 의견을 색인보기에 추가 ... Ruby on Rails
- 17. 이 코드에 어떤 문제가 있습니까?
- 18. 어떻게 subversion.conf에 대한 의견을 남길 수 있습니까?
- 19. 기존 TCP 및 UDP 코드에 SSL 지원을 추가 하시겠습니까?
- 20. iPhone 코드에 대한 UIImageViewControllerPickerSourceTypeCamera
- 21. http://codereview.appspot.com/을 사용하여 소스 코드에 대한 의견을 제출하는 방법은 무엇입니까?
- 22. 이 코드에 해당하는 PHP는 무엇이겠습니까?
- 23. 이 preg_match 코드에 문제가 있습니까?
- 24. 이 코드에 무슨 문제가 있습니까?
- 25. 이 PHP 코드에 오류가 있습니까?
- 26. 이 PHP 코드에 문제가 있습니까?
- 27. 이 코드에 어떤 문제가 있습니까?
- 28. 이 자바 코드에 문제가 있습니까?
- 29. 코드에 대한 설명은 무엇입니까?
- 30. 해시 코드에 대한 이해
하! 내가 이길 것 같아. – BraedenP