0

I posted a question a couple of days ago regarding me making a copy of a popular website.

What I'm looking to do is to do an exact copy of a mobile version of a website, I'm aware its a responsive design, so I enabled emulation in chrome and copied the source it showed, however it throws out errors constantly, which I guess is due to security issues, but I'm totally baffled at how to get around it, below are the errors i'm receiving.

GET file://static.o2.co.uk/shared/js/lib/jquery-2.0.3.min.js?bust=161309052014 net::ERR_FILE_NOT_FOUND require.js:34
Uncaught Error: Script error for: jquery
http://requirejs.org/docs/errors.html#scripterror require.js:8
GET file://static.o2.co.uk/shared/js/lib/le-mtagconfig.js?bust=161309052014 net::ERR_FILE_NOT_FOUND require.js:34
Uncaught Error: Script error for: lib/le-mtagconfig
http://requirejs.org/docs/errors.html#scripterror require.js:8
Uncaught Error: Load timeout for modules: o2/o2.min,plugins.jquery
http://requirejs.org/docs/errors.html#timeout require.js:8
GET file://lptag.liveperson.net/tag/tag.js?site=63960994 net::ERR_FILE_NOT_FOUND le-mtagconfig.js:1
GET file://servedby.o2.co.uk/container/2746;14241;1752;iframe/?ft_referrer=file…//C%3A/Users/Reece/Desktop/Mobile/testing123.html&ns=&cb=371028.8053844124 net::ERR_FILE_NOT_FOUND tracking.min.js:1
XMLHttpRequest cannot load file:///C:/Users/Reece/Desktop/Mobile/api/userdetails?disambiguation_id=. Cross origin requests are only supported for HTTP. angular.js:7836
Error: A network error occurred.
    at Error (native)
    at http://static.o2.co.uk/mymobile/js/lib/angular.min.js:72:139
    at z (http://static.o2.co.uk/mymobile/js/lib/angular.min.js:68:173)
    at h (http://static.o2.co.uk/mymobile/js/lib/angular.min.js:66:157)
    at z (http://static.o2.co.uk/mymobile/js/lib/angular.min.js:91:280)
    at http://static.o2.co.uk/mymobile/js/lib/angular.min.js:92:417
    at g.$eval (http://static.o2.co.uk/mymobile/js/lib/angular.min.js:100:328)
    at g.$digest (http://static.o2.co.uk/mymobile/js/lib/angular.min.js:98:210)
    at g.$apply (http://static.o2.co.uk/mymobile/js/lib/angular.min.js:101:157)
    at http://static.o2.co.uk/mymobile/js/lib/angular.min.js:17:415 angular.js:9101
ReferenceError: $ is not defined

From what I understand so far, it won't run the code as its not being hosted on the original site, but surely theres a way for me to get an exact copy of the site

Any help is greatly appreciated !

When loading up the page on firefox, I receive the following warnings;

Error: http://static.o2.co.uk/mymobile/js/lib/angular.min.js is being assigned a //# sourceMappingURL, but already has one
Error: http://static.o2.co.uk/mymobile/js/lib/angular-route.min.js is being assigned a //# sourceMappingURL, but already has one
Error: http://static.o2.co.uk/mymobile/js/lib/angular-sanitize.min.js is being assigned a //# sourceMappingURL, but already has one
Error: Script error for: jquery
http://requirejs.org/docs/errors.html#scripterror require.js:8
Error: Script error for: lib/le-mtagconfig
http://requirejs.org/docs/errors.html#scripterror
Flexo
  • 87,323
  • 22
  • 191
  • 272
  • Don't use `file://` if you want to use Ajax. Though some browsers include options to enable them together, you're still better off setting up a local HTTP server to host your pages and files. If you only have static files, there are [numerous one- or two-line commands](https://gist.github.com/willurd/5720255) you can use. – Jonathan Lonowski May 15 '14 at 15:06
  • I've updated the question to include the errors I get on firefox, sorry if I sound a little slow guys, pretty new to this –  May 15 '14 at 15:13

1 Answers1

1

I think it's simply because Chrome doesn't allow you to send XmlHttpRequest to your local file. It will work if you bring your app onto the server. Use another browser or add this options.

--allow-file-access-from-files

This answer looks nice. XMLHttpRequest cannot load file. Cross origin requests are only supported for HTTP

Community
  • 1
  • 1
Quv
  • 2,958
  • 4
  • 33
  • 51
  • Thanks for the response, when you say bring the app onto my server, do I download all of the required JS files and refer to them locally? All I need to do is make an exact copy of a mobile site, it doesn't have to be able to function its only for educational purposes –  May 15 '14 at 15:05