<script src="../js/goto.js" type="text/JavaScript"></script>
Comes back as: root/js/goto.js
should be: root/mainfolder/js/goto.js
I tried in the src="/js/goto.js" but does not work either. I keep getting 404 error. Running IIS10. Works on my desktop but not thru the server. All javascripts are doing this. Help!
Related
I have written a small code using index.html and three .js files. It was working fine if i run it through my local. As soon as i uploaded it to github and hosted my webpage and opened it the above error is coming. i am attaching the url of my github page : https://sravya160597.github.io/courseracss/mod4_solution/index.html
please help me if anyone has a solution for this.
Taking a look at the page source, and comparing to your github repository, it appears that the problem is case sensitivity in github pages (whereas your localhost must be case-insensitive). Both your SpeakHello.js and SpeakGoodBye.js should start with a lowercase, as follows:
<head>
...
<script src="js/speakHello.js"></script>
<script src="js/speakGoodBye.js"></script>
<script src="js/script.js"></script>
</head>
I'm having difficulties implementing something simple: I have an index.html file served on http://localhost:3200 by ruby on rails, which uses a javascript file served on http://localhost:8000 by webpack-dev-server.
So here's what I have:
<!doctype html>
<head>
<script crossorigin="anonymous" src="http://localhost:8000/app.js" />
</head>
<!-- ... -->
</html>
My app.js file is sent with, amongst others, the following header:
Access-Control-Allow-Origin: *
What I want is to be able to override window.onerror in app.js, and see caught errors, rather than "Script error".
What am I missing?
-- edit --
Since it might not be clear enough: my script does load. I have no problem with that. My issue is that I need to report errors that happen to somewhere else, but I can't do that since any error that occurs in app.js is reported as "Script error" rather than something more explicit.
What sourcemap (devtool) are you using?
I was getting this issue, and it changing from eval-source-map to source-map fixed it.
This is a google chrome issue, should be when Chrome 71 is released.
Here are the relevant issue threads:
https://bugs.chromium.org/p/chromium/issues/detail?id=765909
https://github.com/webpack/webpack/issues/5681
Edit: This also impacts electron users.
I use primefaces 6.0 and Spark-layout in my project.
It works on localhost very well.
But when I upload it to the server (jboss or tomcat does not differ), sometimes the page cannot load.
It happens randomly. The page stucks while loading.
When I look the server logs :
It waits too much to log this line:
"GET /XXX/javax.faces.resource/images/preloader.gif.xhtml?ln=spark-layout HTTP/1.1" 200 17824
Also I have seen this in log :
"WARNING [http-nio-80-exec-27] com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource JSF1064: Unable to find or serve resource, components.js, from library, primefaces."
I have continued to investigate, and seen that, when the problem occurs, the page waits to load .js files from primefaces library.
Page stucks at this line in the head :
script type="text/javascript" src="/XXX/javax.faces.resource/jquery/jquery.js.xhtml?ln=primefaces&v=6.0">
Other .js files cannot be loaded:
script type="text/javascript"
src="/XXX/javax.faces.resource/jquery/jquery-plugins.js.xhtml?ln=primefaces&v=6.0">
script type="text/javascript"
src="/XXX/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.0">
As a result, what can I do to get rid of this problem :)
Thanks...
I am trying to use the jQuery.load() function, and it works on Firefox, but not on Safari and Chrome. The odd part is that it works on mobile Safari.
All of the posts I found on this subject appeared old and outdated.
Does anyone have a solution to fix this problem?
Here is sample code from my page:
<div class="navButton"></div>
<script>
$(".navButton").load("bottomNav.html");
</script>
The error console tells the story here.
Failed to load resource: the server responded with a status of 404 (Not Found)
http://yellowtailderby.com/jquery-2.1.0.js
Uncaught ReferenceError: $ is not defined
So, when you try to execute:
$(".navButton").load("bottomNav.html");
The $ symbol is not defined because jQuery is not successfully loaded.
The issue seems to be that this:
http://yellowtailderby.com/jquery-2.1.0.js
does not exist (gets a 404 error) so this script tag:
<script src="jquery-2.1.0.js"></script>
is not working properly. The fix is to either correct the script tag or make sure that particular file is properly located on your server at that path.
I am getting the exact same error in Firefox, so I suspect that maybe you have that file in your browser cache in Firefox (so it's getting loaded via cache), but it doesn't actually exist on the server. The Firefox reports:
"NetworkError: 404 Not Found - http://yellowtailderby.com/jquery-2.1.0.js"
This is the line in Default.aspx that I included in my javascript file:
<script type="text/javascript" src="../../MyFiles/JavaScript/JavaScript.js" ></script>
While testing the web with Fiddler, it keeps on saying that my JavaScript.js file is not found (404 error) even though it's really there and works like expected. Any help or hint would be appreciate.
What exactly do you mean when you say "works like expected"?
If Fiddler shows a 404, then either the server returned a 404, or you configured a rule in Fiddler (e.g. "Block JavaScript" on Fiddler's Filters tab).