Ajax не отвечает на удаленном сервере для некоторых ПК - PullRequest
0 голосов
/ 23 октября 2018

* Ajax не отвечает на удаленном сервере для некоторых ПК, но отлично работает в мобильных браузерах и на ПК, на который я загрузил.Пожалуйста, дайте мне знать, в чем проблема с этим

Эта функция Ajax .

<code><pre>


     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
        $('#selTrim').change(function(){
            var trim_id1 = $(this).val();
            if(trim_id1){
                $.ajax({
                    type:'POST',
                    url:'<?= base_url();?>H1_specifications/h1_trim_detail',
                    data:'trim_id1='+trim_id1,
                    success:function(data){
                        $('#specContWrap').html(data);
                        }
                      }); 
                }
                });
           });
         </script>

      

* Этот ответ контроллера воспламенителя Php *. Я использую платформу Code-igniter, пожалуйста, дайте мне знать, что это лучший способ для ответа на запрос.

<code><pre>

public function h1_trim_detail(){
    $id = $_POST['trim_id1'];
    if(isset($_POST['trim_id1']) !== NULL){
        $this->load->model('Admin_panel');

        $rows7 =$this->Admin_panel->select_h1_details_specification($id);
        $rows =$this->Admin_panel->select_h1_Cargo($id);
        $rows1 =$this->Admin_panel->select_h1_engine($id);
        $rows2 =$this->Admin_panel->select_h1_exterior($id);
        $rows3 =$this->Admin_panel->select_h1_feul_comsuption($id);
        $rows4 =$this->Admin_panel->select_h1_weight($id);
        $rows5 =$this->Admin_panel->select_h1_wheels($id);
        $rows6 =$this->Admin_panel->select_h1_transmission($id);

        echo "<div id='specContWrap'>";
            if($rows7 !== false){
                echo "<div id='overViewWrap' class='overViewTableCon'>";
                echo "<div class='overViewTable on'>";
                    echo "<div class='tit'>Overview</div>";
                    echo "<table class='infoTableType'>";
                        echo "<caption>Overview Table</caption>";
                        echo "<tbody>";
                                echo "<tr>";
                                    echo "<th scope='row'>Product label</th>";
                                    echo "<td>Commercial</td>";
                                    echo "</tr>";
                            foreach($rows7 as $row){
                                echo "<tr>";
                                echo "<th scope='row'>Product label</th>";
                                echo "<td>".$row['name']."</td>";
                                echo "</tr>";
                            echo "<tr>";
                                echo "<th scope='row'>Model name</th>";
                                echo "<td>". $row['name_car']."</td>";
                                echo "</tr>";
                            echo "<tr>";
                                echo "<th scope='row'>Seats</th>";
                                echo "<td>". $row['seats']."</td>";
                                echo "</tr>";
                            }

                            echo "</tbody>";
                        echo "</table>";
                    echo "</div>";
                echo "</div>";

            }else{
                echo "Not Found";
            }


            echo "<div class='togListWrap small  sepcListWrap' id='overviewh1'>";
                echo "<div class='togList'>";
                    echo "<button class='btnOpenClose'>Performance</button>";
                    echo "<div class='togCont' id='performanceWrap'>";

                    echo "<div class='performance on'>";
                        if($rows1 !== false){
                            echo "<dl class='specList'>";
                            echo "<dt>Engine Specification</dt>";
                            foreach($rows1 as $row){
                            echo "<dd>";
                                echo "<dl>";
                                    echo "<dt>".$row['label']."</dt>";
                                    echo "<dd>".$row['descriptions']."</dd>";
                                echo "</dl>";
                            echo "</dd>";
                            }
                            echo "</dl><br>";
                        }else{
                            echo "<dt>Engine Specification Not Found</dt><br>";
                        }
                        if($rows3 !== false){
                            echo "<dl class='specList'>";
                            echo "<dt>Feul Comsuption Specification</dt>";
                            foreach($rows3 as $row){
                            echo "<dd>";
                                echo "<dl>";
                                    echo "<dt>".$row['label']."</dt>";
                                    echo "<dd>".$row['description']."</dd>";
                                echo "</dl>";
                            echo "</dd>";
                            }

                            echo "</dl><br>";
                        }else{
                            echo "<dt>Feul Comsuption Specification Not Found</dt><br>";
                        }
                        if($rows6 !== false){
                            echo "<dl class='specList'>";
                            echo "<dt>Transmission Specification</dt>";
                            foreach($rows6 as $row){
                            echo "<dd>";
                                echo "<dl>";
                                    echo "<dt>".$row['label']."</dt>";
                                    echo "<dd>".$row['description']."</dd>";
                                echo "</dl>";
                            echo "</dd>";
                            }

                            echo "</dl><br>";
                        }else{
                            echo "<dt>Transmission Specification Not Found</dt><br>";
                        }
                    echo "</div>";
                echo "</div>";
                echo "</div>";

                echo "<div class='togList'>";
                    echo "<button class='btnOpenClose'>Dimension</button>";
                    echo "<div class='togCont' id='DimensionWrap'>";

                    echo "<div class='Dimension on'>";
                        if($rows2 !== false){
                            echo "<dl class='specList'>";
                            echo "<dt>Exterior Specification</dt>";
                            foreach($rows2 as $row){
                            echo "<dd>";
                                echo "<dl>";
                                    echo "<dt>".$row['label']."</dt>";
                                    echo "<dd>".$row['descriptions']."</dd>";
                                echo "</dl>";
                            echo "</dd>";
                            }
                            echo "</dl><br>";
                        }else{
                            echo "<dt>Exterior Specification Not Found</dt><br>";
                        }
                        if($rows4 !== false){
                            echo "<dl class='specList'>";
                            echo "<dt>Weight Specification</dt>";
                            foreach($rows4 as $row){
                            echo "<dd>";
                                echo "<dl>";
                                    echo "<dt>".$row['label']."</dt>";
                                    echo "<dd>".$row['description']."</dd>";
                                echo "</dl>";
                            echo "</dd><br>";
                            }

                            echo "</dl><br>";
                        }else{
                            echo "<dt>Weight Specification Not Found</dt><br>";
                        }

                        if($rows !== false){
                            echo "<dl class='specList'>";
                            echo "<dt>Cargo Specification</dt>";
                            foreach($rows as $row){
                            echo "<dd>";
                                echo "<dl>";
                                    echo "<dt>".$row['label']."</dt>";
                                    echo "<dd>".$row['description']."</dd>";
                                echo "</dl>";
                            echo "</dd>";
                            }
                            echo "</dl><br>";
                        }else{
                            echo "<dt>Cargo Specification Not Found</dt><br>";
                        }
                    echo "</div>";
                echo "</div>";
                echo "</div>";

                echo "<div class='togList'>";
                    echo "<button class='btnOpenClose'>Wheels</button>";
                    echo "<div class='togCont' id='WheelsWrap'>";

                    echo "<div class='Wheels on'>";
                        if($rows5 !== false){
                            echo "<dl class='specList'>";
                            echo "<dt>Wheels Specification</dt>";
                            foreach($rows5 as $row){
                            echo "<dd>";
                                echo "<dl>";
                                    echo "<dt>".$row['label']."</dt>";
                                    echo "<dd>".$row['descriptions']."</dd>";
                                echo "</dl>";
                            echo "</dd>";
                            }
                            echo "</dl><br>";
                        }else{
                            echo "<dt>Wheels Specification Not Found</dt><br>";
                        }

                    echo "</div>";
                echo "</div>";
                echo "</div>";
            echo "</div>";
        echo "</div>";
    }
}

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...