CodeIgniterµÄAJAX·ÖÒ³ÁíÀàʵÏÖ
¿´ÁËÒ»ÏÂCIµÄ·ÖÒ³ÀàûÓÐдµ½¹ØÓÚAJAXµÄÄÚÈÝ£¬Ò²ÔÚÂÛ̳ÉÏ¿´µ½ÆäËû¼¸Î»´óÉñдµÄ·ÖÒ³ÀàÀ©Õ¹£¬¸Ð¾õÆäʵÊÇûÓбØÒª¡£
ÔÚÏÖÓеĻù´¡ÉÏ×öÁËÒ»ÏÂССµÄ¸Ä¶¯»¹ÊÇÄÜʵÏֵġ£
ÏÂÃæ½øÈëÕýÌ⣺
CIµÄÔÉú·ÖÒ³ÀàÖÐÓÐÒ»¸ö²ÎÊý $config[anchor_class]
Õâ¸ö²ÎÊýÊÇÓÃÀ´ÉèÖ÷ÖÒ³Á´½ÓµÄÑùʽµÄ£¬ËùÒÔÎÒÃÇ¿ÉÒÔÉèÖóÉÕâÑù£º
$config[anchor_class] = "class=ajax_fpage";
È»ºóÔÚview²¿·ÖÕâÑù²ÉÓýûÖ¹a±ãǩĬÈ϶¯×÷µÄ·½·¨À´È¡µÃAJAXµÄµ÷ȡЧ¹û¡£
´úÂëÈçÏ£º
<script>
$(.ajax_fpage).click(function(e){
var url = $(this).attr(href);
$.get(url,{},function(res){
$(#show_what_table).html(res);
});
event.preventDefault();
});
</script>
µ±ajax_fpageµã»÷µÄʱºò£¬½ûÖ¹a±êÇ©µÄĬÈ϶¯×÷£¬²¢µÃµ½hrefÐÅÏ¢£¬È»ºóÓÃget·½·¨È¡µÃhrefµÄÄÚÈÝ£¬²¢¸üÐÂdom.
ÕâÑùÒ»¸öÍêÕûµÄajax·ÖÒ³¾ÍʵÏÖÁË¡£´Ó¶ø²»ÐèÒª¶ÔÔʼµÄÀà½øÐÐÀ©Õ¹ÁË¡£
ÏêϸµÄPHP´úÂëÈçÏ£º
function ContentList($id,$p=0) { $this->load->library(pagination); $config[base_url] = site_url(qyadmin/ContentList/.$id./.$p); $config[total_rows] = $this->admin->content_list($id,$p,1); $config[per_page] = 5; $config[uri_segment] = 5; $config[first_link] = FALSE; $config[last_link] = FALSE; $config[full_tag_open] = <p>; $config[full_tag_close] = </p>; $config[display_pages] = FALSE; $this->load->helper(url); $skin_url = base_url().APPPATH . "views/templates"; $config[next_link] = <img src=".$skin_url./images/page_next.gif">; $config[next_tag_open] = <li class="fr">; $config[next_tag_close] = </li>; $config[prev_link] = <img src=".$skin_url./images/page_prev.gif">; $config[prev_tag_open] = <li class="fr">; $config[prev_tag_close] = </li>; $config[anchor_class] = class="ajax_fpage"; $this->pagination->initialize($config); $content = $this->admin->content_list($id,$p,0,$config[per_page],$this->uri->segment(5)); $fpage = $this->pagination->create_links(); $this->smarty->assign(fpage,$fpage); $this->smarty->assign(content,$content); $this->smarty->view(show.tpl); }
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ