Javascript does not work on the localhost but works on the server

Asked

Viewed 800 times

2

I have a project that has a graphic generated by javascript and angular logo on the home page after a login, however, in my localhost this graph was never shown and I arrived at a part of the work where I need to touch it, however, without seeing it is difficult. However, what is online on the server works normally, but only the Local does not work, I already pulled the files straight from the server to my machine and it just doesn’t show! Does anyone have any solution?

I’ve cleaned cache, already modified some settings google Chrome and firefox (Does not work in any of them and nor in Microsoft Edge), already changed the lines that call the files to the top as I saw in some places but nothing to solve.

Links called in my project.

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>

<script src="<?php echo $portal_path;?>assets/js/site/angular-chart.min.js"></script>

<script src="<?php echo $portal_path;?>assets/js/site/circleOfLifeChart2.js"></script>

<script src="https://rawgit.com/beaver71/Chart.PieceLabel.js/master/build/Chart.PieceLabel.min.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<link rel="stylesheet" type="text/css" href="<?php echo $portal_path;?>assets/css/site/sliderCircleOfLife.css">

In Google Chrome Inspect, I see several errors that happen on Localhost but do not happen on the server. I use the XAMPP.

inserir a descrição da imagem aqui

  • How are you opening your HTML file? By double clicking on the file or serving through a local server?

  • vejo vários erros que acontecem no Localhost.. it would be interesting to edit the question and include these errors

  • Then try to create a server with your own php. For example, php -S localhost:8080. Maybe the error is in the XAMPP configuration

  • What does it display on the console? Does the $portal_path variable refer to your local file? What does it return?

  • @fernandosavio I’m using through localhost, localhost/Colwithgit which is the name of the project.

  • I’m editing the question with the errors that appear on the console

  • @Bruno yes, she looks like this "$portal_path = "//" . $_SERVER['SERVER_NAME'] . " /Colwithgit/";"

  • The mistakes are in the posting, thanks for everyone’s attention!

  • What I want you to run is the Circleoflifechat, on my boss’s machine it works, on mine and the other programmer’s it doesn’t. A detail, I do not know if you have any database configuration, because my the user and password of the database is different from his

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.