1. 程式人生 > >PHP 點選連結更新資料庫,返回值

PHP 點選連結更新資料庫,返回值

<a href="javascript:void(0)" title="收藏" class="c-p-n-txt" id='collection_user'>收藏</a>
<script>//收藏
$('#collection_user').on('click', function(){
				var url = encodeURI("add_js_note.php?action=collection&name=$tt&id_id=$id");
					  //Ajax獲取
					  $.post(url, {}, function(str){
						  layer.msg(str);
					  });
});