Søg i Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

FireFox images not loading in local folders (firebug error-Failed to load given URL)

  • 2 svar
  • 136 har dette problem
  • 4 visninger
  • Seneste svar af richardpd

more options

I am having difficulty when developing websites in local folders (Windows7 computer). The webpages I make are showing images in IE9 & Chrome but not FireFox (nor Safari nor Opera).

In FireFox I get Firebug "Failed to load given URL" prompt. I am using html5 & external linked css stylesheet & the html/html5 & css code validates.

I have tried using rel path ie images/image.gif & absolute path references ie C:/RPD_Programming/RPD WEB/amwcsnew/index.html

and have tried using % to eliminate whitespace in references but I cannot get FireFox to display images!! This has been a problem for me for around 2 weeks now & is very frustrating. Some website code/templates I have downloaded from the internet display the websites properly (ie load images fine) when I open them locally in FireFox. Why does my code not allow the images to load in FireFox (paths/permissions/other issue??). How can I fix this?


Here is example css & html5 not displaying images from local directory in FireFox (fine in IE9 & Chrome):

style.css

/* CSS Document */ /*Basic Reset*/

  • {

margin:0; padding:0; }

html{ }

/* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }

body{ width:1200px; margin:0 auto;

}

header{ height:450px; background:url("C:/RPD_Programming/RPD WEB/amwcsnew/images/header.gif"); background-repeat:no-repeat; }

  1. mid{height:750px;

background:url('C:/RPD_Programming/RPD_WEB/amwcsnew/images/mid.gif')no-repeat; }

footer{height:286px; background:url('C:/RPD_Programming/RPD WEB/amwcsnew/images/footer.gif')no-repeat; }

index.html

<meta charset="utf-8"> <title>amwcs-new</title> <meta name="description" content="amwcs"> <meta name="author" content="rpd"> <link rel="shortcut icon" href="/favicon.ico"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="stylesheet" href="css/style.css?v=2"> <script src="js/modernizr-1.6.min.js"></script>

<header> <hgroup>

amwcs

tagline

</hgroup> <nav> </nav> </header>

Some content...

Demonstrating EM and STRONG

This text will have more importance (SEO-wise and contextually)

This text has visual importance but has no contextual or SEO importance

This is a very colloquial expression.

This is another section

This is some dummy content

<footer>

copyright © year

</footer> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script>!window.jQuery && document.write(unescape('%3Cscript src="js/jquery-1.4.4.min.js"%3E%3C/script%3E'))</script> <script src="js/general.js"></script> <script> var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']]; (function(d, t) { var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = true; g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; s.parentNode.insertBefore(g, s); })(document, 'script'); </script>


I am most grateful for help & look forward to replies & fixing this-thanks

NB Is there a FireFox guide/manual in pdf format available anywhere? I have not found one yet & a FireFox reference might be useful!

I am having difficulty when developing websites in local folders (Windows7 computer). The webpages I make are showing images in IE9 & Chrome but not FireFox (nor Safari nor Opera). In FireFox I get Firebug "Failed to load given URL" prompt. I am using html5 & external linked css stylesheet & the html/html5 & css code validates. I have tried using rel path ie images/image.gif & absolute path references ie C:/RPD_Programming/RPD WEB/amwcsnew/index.html and have tried using % to eliminate whitespace in references but I cannot get FireFox to display images!! This has been a problem for me for around 2 weeks now & is very frustrating. Some website code/templates I have downloaded from the internet display the websites properly (ie load images fine) when I open them locally in FireFox. Why does my code not allow the images to load in FireFox (paths/permissions/other issue??). How can I fix this? Here is example css & html5 not displaying images from local directory in FireFox (fine in IE9 & Chrome): style.css /* CSS Document */ /*Basic Reset*/ *{ margin:0; padding:0; } html{ } /* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } body{ width:1200px; margin:0 auto; } header{ height:450px; background:url("C:/RPD_Programming/RPD WEB/amwcsnew/images/header.gif"); background-repeat:no-repeat; } #mid{height:750px; background:url('C:/RPD_Programming/RPD_WEB/amwcsnew/images/mid.gif')no-repeat; } footer{height:286px; background:url('C:/RPD_Programming/RPD WEB/amwcsnew/images/footer.gif')no-repeat; } index.html <!doctype html><!-- simplified doctype works for all previous versions of HTML as well --> <!--html5 template from www.impressivewebs.com_modified by RPD--> <!-- Paul Irish's technique for targeting IE, modified to only target IE6, applied to the html element instead of body --> <!--[if lt IE 7 ]><html lang="en" class="no-js ie6"><![endif]--> <!--[if (gt IE 6)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]--> <head> <!-- simplified character encoding --> <meta charset="utf-8"> <title>amwcs-new</title> <meta name="description" content="amwcs"> <meta name="author" content="rpd"> <!-- Delete these two icon references once you've placed them in the root directory with these file names --> <!-- favicon 16x16 --> <link rel="shortcut icon" href="/favicon.ico"> <!-- apple touch icon 57x57 --> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <!-- Main style sheet. Change version number in query string to force styles refresh --> <!-- Link element no longer needs type attribute --> <!-- <link rel="stylesheet" type="text/css" media="all" href="css/style.css" />--> <link rel="stylesheet" href="css/style.css?v=2"> <!-- Modernizr for feature detection of CSS3 and HTML5; must be placed in the "head" --> <!-- Script tag no longer needs type attribute --> <script src="js/modernizr-1.6.min.js"></script> <!-- Remove the script reference below if you're using Modernizr --> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <!-- If possible, use the body as the container --> <!-- The "home" class is an example of a dynamic class created on the server for page-specific targeting <body class="home">--> <body> <!-- ******************************************************************** --> <!-- The content below is for demonstration of some common HTML5 elements --> <!-- More than likely you'll rip out everything except header/section/footer and start fresh --> <!-- First header has an ID so you can give it individual styles, and target stuff inside it <header id="hd1"> No way Hosay-not by default! Default is <header> tag (RPD edit) --> <header> <!-- "hgroup" is used to make two headings into one, to prevent a new document node from forming --> <hgroup> <h1>amwcs</h1> <h2>tagline</h2> </hgroup> <!-- Main nav, styled by targeting "#hd1 nav"; you can have more than one nav element per page --> <nav> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Services</a></li> <li><a href="#">Contact</a></li> </ul> </nav> </header><!--End header & or #hd1 header div id if used--> <!-- This is the main "div" that wraps the content generically; don't use "section" for this --> <div id="mid"> <!-- The first of two "section" elements for demo purposes; optional class added for styling (hs1 = "home section 1") --> <section class="hs1"> <!-- Each section should begin with a new h1 (not h2), and optionally a header --> <!-- You can have more than one header/footer pair on a page <header> <h1>This is a Page Sub Title</h1> </header> --> <p>Some content...</p> <!-- The h2 below is a sub heading relative to the h1 in this section, not for the whole document --> <h2>Demonstrating EM and STRONG</h2> <!-- "strong" is used for SEO and contextual hierarchy --> <p><strong>This text will have more importance (SEO-wise and contextually)</strong></p> <!-- "b" is used for stylistic offset of text that's NOT important contextually --> <p><b>This text has visual importance but has no contextual or SEO importance</b></p> <!-- "em" is used for colloquial-style emphasis --> <p>This is a <em>very</em> colloquial expression.</p> <!-- There can be multiple footers on each page --> <!-- Secondary headers and footers don't necesarily need ids; they can be targeted via context (i.e. ".hs1 footer") <footer> <!-- incite a riot: http://24ways.org/2009/incite-a-riot <p>Author: <cite>Louis Lazaris</cite></p> </footer> --> </section><!-- .hs1 --> <!-- This is another section; doesn't have header/footer because it's not required --> <section class="hs2"> <h1>This is another section</h1> <p>This is some dummy content</p> </section><!-- .hs2 --> </div><!-- #mid --> <!-- The "aside" element could be a sidebar (outside an article or section) --> <!-- Or it could reference other tangentially-related content within an article or section <aside id="sidebar"> <p>Sidebar content</p> </aside>--> <!-- The main footer has an ID for targeting, similar to the main header --> <footer > <p>copyright &copy; year</p> </footer> <!-- Remote jQuery with local fallback; taken from HTML5 Boilerplate http://html5boilerplate.com --> <!-- jQuery version might not be the latest; check jquery.com --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script>!window.jQuery && document.write(unescape('%3Cscript src="js/jquery-1.4.4.min.js"%3E%3C/script%3E'))</script> <!-- Below is your script file, which has a basic JavaScript design pattern that you can optionally use --> <!-- Keep this and plugin scripts at the bottom for faster page load; combining and minifying scripts is recommended --> <script src="js/general.js"></script> <!-- asynchronous analytics code by Mathias Bynens; change UA-XXXXX-X to your own code; http://mathiasbynens.be/notes/async-analytics-snippet --> <!-- this can also be placed in the <head> if you want page views to be tracked quicker --> <script> var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']]; (function(d, t) { var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = true; g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; s.parentNode.insertBefore(g, s); })(document, 'script'); </script> </body> </html> I am most grateful for help & look forward to replies & fixing this-thanks NB Is there a FireFox guide/manual in pdf format available anywhere? I have not found one yet & a FireFox reference might be useful!

Alle svar (2)

more options

You need to use file:// as the protocol instead of C:/. The latter may never work (C:\ might).

Where is the main HTML located ?

Easiest if to store the images in a sub folder of the location because you can't go back via ../ beyond that root location for security reasons.

See:

more options

Hi cor-el Thank you so much! Your solution works. I have not yet visited your link but will do so after sending this message.

I have not seen this file path protocol before-(is it new to FireFox4? I don't think I had this problem a few months ago with an older firefox version). This protocol works for both IE9 & Firefox (does it work for all other browsers-Opera,Safari,Chrome?-I will test it out!).

For me this style rule works: background: url("file:///C:/RPD_Programming/RPD%20WEB/amwcsnew/images/header.gif");

here I have file:/// (not file://) & white space in directory name eliminated with %20 (ie RPD%20WEB). Easy way for me to do it is to open the html file locally in FireFox and copy the address from the address bar & paste it into my style.css css rules!

Many, many thanks for replying & fixing this issue for me (this was a very frustrating problem for me & hampering my web developing!! No problem now...).

Is there a good manual (pdf) for help on using Firefox anywhere?

Again thank you for your prompt and very helpful reply and best wishes to you