My lightbox script won't load - javascript

Hey I'm trying to get this lightbox script to work on a client site but I get this error '$ is not defined', I'm not well with JS so i was wondering if i could get some help, heres the site - http://www.petconnection.com/blog/.
Thanks, Antonio.

Here's the problem:
/res/javascript/lightbox/jquery.lightbox-0.5.js
Failed to load resource: the server responded with a status of 404 (Not Found)
/res/javascript/jquery/jquery-1.4.2.min.js
Failed to load resource: the server responded with a status of 404 (Not Found)
The page is trying to retrieve the JavaScript file that defines jQuery (hence $) but the server is replying with a 404 error. Either it's requesting the wrong URL, or the file has been deleted from the server — perhaps replaced by a new version of jQuery (1.4.2 is pretty old at this point, we're on to 1.5).
The order of those messages also indicates that you're (trying to) load the the lightbox script before the jQuery script. This is bad juju. Lightbox depends on jQuery, so you've got to load jQuery first.

Antonio, it doesn't look like either of your scripts are loading properly. Try linking directly (instead of relative links) or just double check the links you currently have.

Related

Replacing img src with different src gives 404 in the console

In a script I'm using (jQuery but that's not relevant to the question) I have:
$(this).attr('src',$(this).attr('src').replace('.png','.gif'));
This works fine, but I noticed that after I've replaced the PNG, the console shows:
Failed to load resource: the server responded with a status of 404 ()
https://www.example.com/image.png
I like my current setup, but given the errors (multiple as I do the replacement on multiple images) this is probably a bad idea. Should I instead replace the whole <img> tag?

Wikipedia api error for images when page is loaded locally

I created a simple web form that pulls a wikipedia article and renders it on the page: https://fiddle.jshell.net/isachenx/b223kth6/
Everything is fine in the fiddle, but when used locally, I get errors when the ajax request tries to get the thumbnail images from the wikipedia page.
The error in the console reads:
GET file://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Paleis_op_de_dam.JPG/129px-Paleis_op_de_dam.JPG net::ERR_FILE_NOT_FOUND
How can I get the request to get the images correctly? Change file:// to https:// ? How?
I don't need the images, but I'd like the console to stop throwing me errors...

Custom 404 page causing sub file to not load javascript

I am not 100% sure if this is my issue, but this is what I have narrowed it down to. I created a sub folder and added a file to it. When I open up this page's console, I get the following error.
Error:
Uncaught SyntaxError: Unexpected token < 404custom:1
Which is just this:
<!DOCTYPE html>
My javascript files will not load because of this. I call my custom 404 page in my .htaccess file, like this:
ErrorDocument 404 http://www.website.com/404custom
The page's destination is fine and the new sub file loads. Is the way I am calling the 404 page wrong and not able to work with a sub-folder? I do not get the error in any of my other files in the root of the site.
ErrorDocument 404 http://www.website.com/404custom
Your custom error document should be defined like:
ErrorDocument 404 /404custom.php
If you specify an absolute URL for the ErrorDocument then it will trigger an external redirect, you will lose all the error information and your system then processes the error document URL, which you then need to rewrite to append the .php extension. All of that is unnecessary and should be avoided.
If it's all on the one server then the error document should be triggered with an internal subrequest. The user never sees /404custom.php, only the URL that triggered the error in the first place.
You also need to make sure that your error documents are excluded from any rewrites you might already be doing (like appending file extensions etc.)

I can see a webpage on a local computer, but after uploading it the pictures don't appear

I try to use a template provided here:
http://themes.alessioatzeni.com/html/brushed/
Then, I downloaded the basic files and modified them for my purpose. It was OK. I didn't have any problem to see the pages on my computer. I tested it with Edge, Chrome, and Fire Fox. Everything showed it very well. Then, I uploaded all the files on my website:
http://hirophysics.com/japaneseusedcar/bahama-used-car.html
Then, there is no picture on the slider and also I cannot find the right and left arrows on the menu bar...
I checked if all the file are uploaded. I found everything on the server. I didn't use any foreign language...
Would someone possibly advise me where the problem is hidden?
Thank you very much!
Hiro
I would go with the typical reason: wrong url to a resource. Often, when you are launching the page locally you get a bit different url than on the server. And your errors show exactly that error
Failed to load resource: the server responded with a status of 404 (Not Found)
So check again, if the URL you provided is correct. And as I said, the URL might be different between local and server eventho folder looks exactly the same.
http://hirophysics.com/japaneseusedcar/_include/img/logo.png Failed to load resource: the server responded with a status of 404 (Not Found)
Try to use your resources with additional ".." before directory where they are (for example you have
_include/img/logo.png so try ../_include/img/logo.png)

d3.js / JSFiddle - loading .tsv data

I created a JSfiddle to collaborate on a project but I can't get it to run properly:
It's loading correctly the html/css elements
It's apparently running the .js code as the dimensions (960*500 px )of the result look correct to me
However it does not seem to load the dataEL.tsv file I attached as an external resource, and that I use in my code to load data via:
window.onload = function draw(data) {
d3.tsv("dataEL.tsv", type, function(error, data) {
(...)
=> Here is the link to the JSfiddle
Can you please help me load correctly the data in order to display the result?
It displays correctly on my personal server
I don't think jsFiddle.net lets you upload external resources other than referencing JS files.
If you open the Javascript console, or Developer Tools of your browser (F12 assuming you are on Windows and using IE/Chrome/FF) you see that you are getting a 404 not found error for the file dataEl.tsv:
Failed to load resource: the server responded with a status of 404
(NOT FOUND) http://fiddle.jshell.net/46yxnukv/2/show/dataEL.tsv
You could try a different site, or upload the file dataEL.tsv to an internet-accessible web server and then request it using the full URL instead of an URL on jsFiddle.net.

Categories

Resources