Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Only showing in Firefox #1

Open
Tambe257 opened this issue Jun 12, 2014 · 4 comments
Open

Only showing in Firefox #1

Tambe257 opened this issue Jun 12, 2014 · 4 comments

Comments

@Tambe257
Copy link

Is there a simple reason that this app will work in Firefox, but not in Chrome or Safari?

@al-the-x
Copy link
Contributor

No, it was developed in Chrome, actually. This repo was the WIP app used in the course, so there may be some drift. What issues are you having? Screenies are appreciated. ;)

@al-the-x
Copy link
Contributor

I did note that the addReview() function was b0rk3d.

@Tambe257
Copy link
Author

I'm a newbie to Angular, so it might be simple. I download your source
code, and when I open it in Safari or Chrome it's a blank page. When I open
it in Firefox it works fine. It's odd, because I would expect Chrome to be
where it works. Other Angular apps work in Chrome, so it's not that a
setting isn't enabled. I also tried it on my work computer and it worked in
Firefox, but not in Chrome or IE. Here's the error log:

Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///C:/Users/ttambe/Desktop/New%20folder/styles/app.css
XMLHttpRequest cannot load
file:///C:/Users/ttambe/Desktop/New%20folder/product-title.html. Cross
origin requests are only supported for HTTP. index.html:1
file:///C:/Users/ttambe/Desktop/New%20folder/index.html

  1. Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load '
    file:///C:/Users/ttambe/Desktop/New%20folder/product-title.html'. at
    Error (native) at
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:73:498
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js at
    y (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:69:218
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at h (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:67:199
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at C (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:94:187
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at C (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:94:187
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:95:350
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js at
    h.$eval (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:104:370
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at h.$digest (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:102:121
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at h.$apply (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:105:173
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    angular.min.js:86

XMLHttpRequest cannot load
file:///C:/Users/ttambe/Desktop/New%20folder/product-gallery.html. Cross
origin requests are only supported for HTTP. index.html:1
file:///C:/Users/ttambe/Desktop/New%20folder/index.html

  1. Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load '
    file:///C:/Users/ttambe/Desktop/New%20folder/product-gallery.html'. at
    Error (native) at
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:73:498
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js at
    y (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:69:218
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at h (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:67:199
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at C (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:94:187
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at C (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:94:187
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:95:350
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js at
    h.$eval (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:104:370
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at h.$digest (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:102:121
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    at h.$apply (
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js:105:173
    file:///C:/Users/ttambe/Desktop/New%20folder/scripts/angular.min.js)
    angular.min.js:86

On Fri, Jun 13, 2014 at 10:40 AM, David Rogers [email protected]
wrote:

I did note that the addReview() function was b0rk3d.


Reply to this email directly or view it on GitHub
#1 (comment)
.

@al-the-x
Copy link
Contributor

Ah. Here's your problem:

file:///C:/Users/ttambe/Desktop/New%20folder/product-title.html. Cross origin requests are only supported for HTTP. index.html:1

Here's a post on SO that explains: http://j.mp/1hQRUpy

You need to run the app through a web server or use the --allow-file-access-from-files flag to Chrome to use file:// URLs. Instead of figuring out how to install a web server, you can load the project up in Brackets (http://brackets.io) and use the live-preview feature. Much simpler.

If you really want the dead-simplest web server (time and) money can buy, install Python (http://j.mp/1hQSH9P) and run python -m SimpleHttpServer in the project directory. Then visit http://localhost:8000 in your browser.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants