2013-06-21 37 views
0

我有如下動作:AJAX,PHP,CodeIgniter - 無法從操作中獲取價值?

http://img560.imageshack.us/img560/857/f1s.png

和行動:

http://img153.imageshack.us/img153/1559/lxe.png

<div class="options"> 
    <div class="grid-list"> 
     <a id="grid" class="grid curent" href="javascript:void(0)" title="Grid"><span>img</span></a> 
     <a id="list" class="list" href="javascript:void(0)" title="List"><span>img</span></a> 
    </div><!-- .grid-list --> 
</div><!-- .options --> 


當我點擊標籤,只有beforeSend(阿賈克斯)作品。請幫幫我!

P/S:我很抱歉!我不能發佈我的代碼,因爲我得到一個錯誤「它看起來像你的文章大多是代碼請加一些細節」

+0

包含'error'或'fail'函數......看起來像是在拋出錯誤 –

+0

您是否看到任何錯誤在控制檯中的Ajax ..? –

+0

我看不到任何錯誤,因爲瀏覽器不顯示任何錯誤。這是我的項目https://www.box.com/files/0/f/950402871/1/f_8789300133(2.6 MB) –

回答

1

您可以使用下面的代碼在你的PHP 功能

$view_type=$_POST['viewType'];

1

首先在url中使用你的base_url在ajax請求中,在你的config中定義base_url。 在控制器中使用$ view_type = $ this-> input-> post('viewType')

+0

謝謝!我做到了。 –