ajax get
来源:互联网 发布:无锡国际学校知乎 编辑:程序博客网 时间:2024/05/02 15:50
1、html
<a href="{:U('changeStatus',array('id'=>$row['id'],'status'=>-1))}" class="ajax-get" title="移除">移除</a>2、引入jquery
<script type="text/javascript" src="__JS__/jquery-1.11.1.js"></script>
3、css代码
4、js代码.fixed{ position: fixed!important;}/* 提醒框 来自于onethink*/.alert { color: #c09853; font-weight: bold; border: 1px solid #fbeed5; background-color: #fcf8e3;}.alert .close { float: right; position: relative; top: -2px; right: -21px; font: bold 20px/20px arial; color: #c09853; opacity: 0.4;}.alert .close:hover { opacity: 0.6;}button.close { padding: 0; cursor: pointer; border: 0 none; background: none;}.close { float: right; font-size: 20px; font-weight: bold; line-height: 20px; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20);}.alert-info { background-color: #D9EDF7; border-color: #BCE8F1; color: #3A87AD;}.alert-error { color: white; border-color: #eed3d7; background-color: #FF6666;}.alert-success { color: #468847; background-color: #CCFF99; border-color: #eed3d7;}#top-alert { display: block; top: -10px; left: 10px; right: 11px; z-index: 3000; margin-top: 20px; padding-top: 12px; padding-bottom: 12px; overflow: hidden; font-size: 16px;}#top-alert .close{ right:14px; position: fixed; top:4px;}.alert-content{ margin-left: 14px; max-width:600px; word-wrap: break-word; word-break: break-word;}
$(".ajax-get").click(function(){ var target = $(this).attr('href'); console.debug(target); $.get(target,function(data){ console.debug(data); var top_alert = $("#top-alert"); if(data.status){ top_alert.addClass('alert-success'); } else { top_alert.addClass('alert-error'); } $('.alert-content').text(data.info); top_alert.show(); setTimeout(function(){ if(data.url){ location.href =data.url; }else{ location.reload(true); } },'2000'); }); return false;});
0 0
- ajax-GET
- Ajax get
- ajax get
- $.ajax(),$.get()
- ajax 传值 ajax、post、get
- Ajax Get or Post
- Ajax Get in ecshop
- ajax XMLHttpRequest post get
- JQuery--Ajax--get方法
- AJAX ,GET POST区别
- jquery ajax post get
- jQuery ajax - get() 方法
- Ajax的get请求
- Ajax的get请求
- $.get、$.post、$.getJSON、$.ajax
- 基于Get的AJAX
- Ajax发送GET请求
- Ajax(1):get请求
- HDU 5446 Unknown Treasure(Lucas定理+CRT)
- Xamarin 移动开发介绍
- Spring MVC SimpleUrlHandlerMapping example
- 创业是一种乐趣
- 基于注解的Spring AOP的配置和使用
- ajax get
- Android, 升级SDK后ADT版本不匹配的问题
- python的while语法
- python函数返回多个值
- iOS开发:UITouch控件与触摸事件
- html 标签基础
- C++中的const和define详解
- HDU 5439 Aggregated Counting(找规律+预处理)
- 并发与乐观锁