<head> <head> <title>It's unkoタイム</title>        <!-- JS -->        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>        <script src="http://localhost/fuelphp-1.7.3/public/assets/js/detail.js"></script> </head> {% block content %}<table border="1" width="600" cellspacing="0" cellpadding="5" bordercolor="#333333"><tr> <span class= "error"></span> <th bgcolor="#8EF1FF">ID</th> <th bgcolor="#8EF1FF">名字</th> <th bgcolor="#8EF1FF">名前</th> <th bgcolor="#8EF1FF">名字カナ</th> <th bgcolor="#8EF1FF">名前カナ</th> <th bgcolor="#8EF1FF">役職</th> <th bgcolor="#8EF1FF">部署</th>
</tr>
{% for item in resultarray %}<tr id = {{ item.id }} > <td class = "iddiv">{{ item.id }}</td> <td>{{ item.family_name}}</td> <td>{{ item.given_name }}</td> <td>{{ item.phonetic_of_family_name }}</td> <td>{{ item.phonetic_of_given_name }}</td> <td>{{ item.assigned_name }}</td> <td>{{ item.affiliation_result}}</td></tr> <tr ><td align="center" colspan = "7"><div "style= display:" >aaa</div></td></tr>{% endfor %}
</table>{{ random() }}{% endblock %}

 

 

 

 

 

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<detail.js>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

$(function (){ $(function (){ $(".iddiv").click(function(){ var thisrow = $(this).parent(); var thisrowid = $(thisrow).attr("id"); console.log(thisrowid); $(function(){ $.ajax({ url:'http://localhost/fuelphp-1.7.3/public/index.php/detail/detail.json', type:'POST', dataType:"JSON", data: { "employee_id": thisrowid }, success:function(data){ var jsondata = JSON.parse(data) console.log(jsondata); console.log(jsondata['id']);                     },                     error:function(data){ //DOM操作がわかんないや console.log('エラーっすわ');                     }

                })             }); }); });

 

 

 

<<<<<<<<>>>>>れすとこん>>>>>>>>>>>>>>>>>

<?php<?phpclass Controller_Detail extends Controller_Rest{ public function post_detail() { $value = \Input::post('employee_id'); $result = Model_Employee::find($value, array('select' => array('picture_url', 'comments'))); return $this->response($result); }}