IZor25
IZor25

Reputation: 15

Why I have this error with Ajax?

In this website, I want to load my pages with JQuery and Ajax by clicking on a menue point.

The problem is, that I have errors by loading it.
What does the Error "GET 'path to css file'" in the console mean?
(there is some Ajax code by clicking on error)

It seems that the browser doesn't load the whole css file in the content.
I hope that you can help me, because I don't now what could be wrong.

Here is my code:

JQuery/Ajax:

$(document).ready(function(){

 $("menue li > a").click(function(){
   var hash = this.hash.substr(1);

    if(hash){
      console.log(hash);
      $(document.body).load("js/sv_index.php",  {id:hash});
  }
 });
});

PHP

<?php
  $id = $_POST['id'];

  switch($id){
    case ("index"):
        include '../index.php';
        break;

    case("tutorials"):
        include '../php/tutorials.php';
        break;

    case("news"):
        include '../php/news.php';
        break;

    case("terminal"):
        include '../php/terminal.php';
        break;

    case("anmeldung"):
        include '../php/anmeldung.php';
        break;
  }
?>

Upvotes: 1

Views: 51

Answers (1)

gaw89
gaw89

Reputation: 1068

It probably means that the web page is looking for your CSS file in 'path to CSS file' and doesn't find it there. Are you sure that your CSS link goes to the correct location and that your server is properly configured to serve the static files?

Upvotes: 1

Related Questions