Bonjour et merci d'avance pour votre aide.
Le petit loader qui sert à afficher des nouveaux produits quand on arrive an bas de page ne fonctionne pas. Le loader tourne en boucle mais les produits ne s'affichent pas. Pouvez vous m'aider. Il s agit de mon site mais ce n est pas moi qui ai créé le code. Merci, j ai vraiment besoin d'aide.
Voici le code de la page. C est le même code qui est utilisé sur toutes les pages.
Voici le code du Controller qui gère ce script:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135 <script type="text/javascript"> function ajaxpage(n){ var xmlHttp; try{ xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari } catch (e){ try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("<?php echo NO_AJAX;?>"); return false; } } } xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ setTimeout(function(){ document.getElementById('ajaxdiv').innerHTML=xmlHttp.responseText; document.id('ajaxdiv').tween('opacity', 1); },500); } } document.id('ajaxdiv').tween('opacity', 0); xmlHttp.open("GET","<?php echo site_url();?>project//<?php echo $project_category_id; ?>/"+n+"/"+<?php echo time(); ?>,true); xmlHttp.send(null); } </script> <div class="section_top"> <div class="main"> <div class="txt_heading" style="padding:40px 0px;"> <h1><?php echo SHARE_SEARCH;?></h1> </div> <div class="card_section"> <div class="card_section_left"> <!--====================left==============--> <?php $category=mysql_fetch_array(mysql_query("select * from project_category where project_category_id='".$project_category_id."'"));?> <h2 class="project_title" style="margin:0px 0px 15px 0px;"> <?php if($_SESSION['lang_code'] == 'fr') { echo RESULT_FOUND_FOR." ".$category['project_category_name_fr']; } else { echo RESULT_FOUND_FOR." ".$category['project_category_name']; } ?></h2> <script type="text/javascript"> var gmts=0; jQuery(document).ready(function() { ////===scrollin data fetch part function last_msg_funtion() { var ID=$(".slider_div:last").attr("id"); var myArray = ID.split('_'); gmts=1; $.post("<?php echo site_url('project/category_project_ajax/');?>"+myArray[1], function(data) { //alert(data) if (data != "") { if(gmts==1) { $(".slider_div:last").after(data); gmts=0; } } else { $('#last_msg_loader').html(''); } //$('div#last_msg_loader').empty(); } ); }; jQuery(window).scroll(function() { var ID=$(".slider_div:last").attr("id"); var myArray = ID.split('_'); var limit = '<?php echo $total_rows; ?>'; if(parseInt(myArray[1]) > parseInt(limit)) { $('#last_msg_loader').html(''); } else { if($(window).scrollTop() == $(document).height() - $(window).height()) { $('#last_msg_loader').html('<div class="clear"></div><h3 class="discover" style="text-align:center;"><img src="<?php echo base_url();?>images/loading25.gif" alt="" /></h3>'); setTimeout(function() { last_msg_funtion(); }, 2000); } } }); }); </script> <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>js2/skin.css" /> <div id="SlideItMoo_items"> <?php if($result) { foreach($result as $rs) { $data['site_setting'] = $site_setting; $data['rs'] = $rs; $this->load->view('common_card',$data); ?> <?php } ?> <?php } else{ ?> <p> <h3><?php echo NO_RESULT_FOUND; ?></h3> </p> <?php } ?> <div id="last_msg_loader"></div> <div class="clear"></div> </div> <!--====================left end==============--> </div>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71 /////////////============Project Category ===================== function category($id=0, $offset=0) { $this->load->library('pagination'); $limit = 9; $config['base_url'] = site_url('project/category_project/'.$id.'/'); $config['total_rows'] = $this->project_model->get_total_category_project($id); $config['per_page'] = $limit; $this->pagination->initialize($config); $data['page_link'] = $this->pagination->create_links(); $data['total_rows'] = $config['total_rows']; $data['per_page'] = $limit; $data['offset'] = $offset; $data['limit'] = $limit; $data['project_category_id'] = $id; $data['idea']=$this->home_model->get_idea(); $data['result'] = $this->project_model->get_category_project($id, $offset, $limit); $data['gallery']=$this->home_model->get_gallery(); $data['site_setting'] = $this->home_model->select_site_setting(); $data['category'] = $this->home_model->get_category(); $data['dvd_category'] = $this->home_model->get_dvd_category(); $data['alternative_category'] = $this->home_model->get_alternative_category(); $data['advertise']=$this->home_model->get_advertise(); $meta = $this->home_model->select_meta_setting(); $data['searchprj'] = ""; $data['header_menu']=$this->home_model->dynamic_menu(0); $data['footer_menu']=$this->home_model->dynamic_menu_footer(0); $data['right_menu']=$this->home_model->dynamic_menu_right(0); $this->home_model->select_text(); $this->template->write('meta_title','Category-'. $meta['title'], TRUE); $this->template->write('meta_description','Category-'. $meta['meta_description'], TRUE); $this->template->write('meta_keyword','Category-'. $meta['meta_keyword'], TRUE); $this->template->write_view('search', 'search', $data, TRUE); $this->template->write_view('header', 'header', $data, TRUE); $this->template->write_view('main_content', 'category_project', $data, TRUE); /* if($_SESSION['lang_code'] == 'fr') { $this->template->write_view('sidebar', 'category_french', $data, TRUE); } else { $this->template->write_view('sidebar', 'category', $data, TRUE); } */ $this->template->write_view('footer', 'footer',$data, TRUE); $this->template->render(); } function category_project_ajax($id=0, $offset=0) { $limit = 9; $data['total_rows'] = $this->project_model->get_total_category_project($id); $data['per_page'] = $limit; $data['offset'] = $offset; $data['project_category_id'] = $id; $data['site_setting'] = $this->home_model->select_site_setting(); $data['limit'] = $limit; $data['result'] = $this->project_model->get_category_project($id, $offset, $limit); $this->load->view('category_project_ajax', $data); }
Avec firebug il affiche comme erreur pour la page:
Je n ai pas de fichier category_project_ajax9 dans mes dossier mais un fichier category_project_ajax.php. De plus je ne trouve nulle part de trace d'un code avec category_project_ajax9 dedans apres avoir effectué une recherche dans notepad.POST monsite.com/index.php/project/category_project_ajax9 404 Not Found 106ms jquery-1.7.2.js (ligne 8240)
error:
"NetworkError: 404 Not Found - http://monsite.com/index.php/project/category_project_ajax9"
je constate que c est le "9" de "&limit=9" du Controller qui vient se coller à l adresse de la page et ca donne une adresse monsite.com/index.php/project/category_project_ajax9 qui n existe pas ! à votre avis où est l'erreur de syntaxe du code du controller ? Merci pour votre aide
Partager