thinkphp 點擊某個class提交post值,返回回來用一個彈窗外掛程式,提示返回來要說的話

來源:互聯網
上載者:User

標籤:中心   type   think   index   color   err   splay   text   關閉   

下一篇文章有講到彈窗外掛程式的怎麼使用,自寫教程 如果能幫到你,給點個贊鼓勵一下

《=============  控制器  =================》

public function index(){ $uid = session(‘uid‘); if($uid <= 0){ $url = "/Home/User/login.html"; echo ‘<script type="text/javascript">alert("跳轉登入!");window.location.href = "‘.$url.‘"; </script>‘; //另一種方法 $this->error(‘請先登陸,馬上跳轉‘); } $this->display(); }《============= 模板 =================》    a class="nav-a geren " href="javascript:;"> <div class="icon"><img src="__PUBLIC__/picture/footer-nav5.png" /></div> <p>個人中心</p> </a> 《============= js =================》<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/gwc/layer.css"> <!--彈窗必須引用的 js--><script type="text/javascript" src="__PUBLIC__/css/gwc/layer.js"></script><!--彈窗必須引用的 css--><script> $(‘.geren‘).click(function(){ var url = "{:U(‘Geren/index‘)}"; $.get(url,‘‘,function(v){ if(!v.status){ layer.open({ content: v.info //判斷哪個值沒填寫 ,skin: ‘msg‘ ,time: 3 //3秒後自動關閉 }); setTimeout(function(){ location.href="{:U(‘User/login‘)}"; },1200); }else{ iocatron.href="{U(‘Geren/index‘)}"; } }) })</script>window.history.back();//記憶誰請求的的此頁面,後台傳過來$this->success();此方法,就是已完成,然後再跳轉到記憶誰請求的頁面location.reload();後台傳過來$this->success();此方法,就是相當於true,在當前頁面重新整理

 

thinkphp 點擊某個class提交post值,返回回來用一個彈窗外掛程式,提示返回來要說的話

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.