[solved] In chrome ionic html file is not working


#1

hello i am new in ionic framework.
my problem is that when i am running html file in chrome browser the view of html file(displaying blank white page) is not appear but if i go through the firefox is working fine.

i want to use chrome because it provide functionality for local and web database. i found some error while running file in chrome,

Error: Failed to execute ‘send’ on ‘XMLHttpRequest’: Failed to load ‘file:///C:/Users/vinay/Desktop/olx_ionic/templates/event-menu.html’.
at Error (native)
at file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:17405:11
at sendReq (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:17208:9)
at $http.serverRequest (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:16949:16)
at wrappedCallback (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20406:81)
at wrappedCallback (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20406:81)
at file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20492:26
at Scope.$eval (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21516:28)
at Scope.$digest (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21328:31)
at Scope.$apply (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21620:24) ionic.bundle.js:18897
XMLHttpRequest cannot load file:///C:/Users/vinay/Desktop/olx_ionic/templates/home.html. Cross origin requests are only supported for HTTP. ionic.bundle.js:17405
(anonymous function) ionic.bundle.js:17405
sendReq ionic.bundle.js:17208
$http.serverRequest ionic.bundle.js:16949
wrappedCallback ionic.bundle.js:20406
wrappedCallback ionic.bundle.js:20406
(anonymous function) ionic.bundle.js:20492
Scope.$eval ionic.bundle.js:21516
Scope.$digest ionic.bundle.js:21328
Scope.$apply ionic.bundle.js:21620
(anonymous function) ionic.bundle.js:23127
completeOutstandingRequest ionic.bundle.js:13328
(anonymous function) ionic.bundle.js:13629
Error: Failed to execute ‘send’ on ‘XMLHttpRequest’: Failed to load ‘file:///C:/Users/vinay/Desktop/olx_ionic/templates/home.html’.
at Error (native)
at file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:17405:11
at sendReq (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:17208:9)
at $http.serverRequest (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:16949:16)
at wrappedCallback (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20406:81)
at wrappedCallback (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20406:81)
at file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20492:26
at Scope.$eval (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21516:28)
at Scope.$digest (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21328:31)
at Scope.$apply (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21620:24) ionic.bundle.js:18897
(anonymous function) ionic.bundle.js:18897
(anonymous function) ionic.bundle.js:16244
wrappedCallback ionic.bundle.js:20409
wrappedCallback ionic.bundle.js:20406
(anonymous function) ionic.bundle.js:20492
Scope.$eval ionic.bundle.js:21516
Scope.$digest ionic.bundle.js:21328
Scope.$apply ionic.bundle.js:21620
(anonymous function) ionic.bundle.js:23127
completeOutstandingRequest ionic.bundle.js:13328
(anonymous function) ionic.bundle.js:13629
XMLHttpRequest cannot load file:///C:/Users/vinay/Desktop/olx_ionic/templates/event-menu.html. Cross origin requests are only supported for HTTP. ionic.bundle.js:17405
(anonymous function) ionic.bundle.js:17405
sendReq ionic.bundle.js:17208
$http.serverRequest ionic.bundle.js:16949
wrappedCallback ionic.bundle.js:20406
wrappedCallback ionic.bundle.js:20406
(anonymous function) ionic.bundle.js:20492
Scope.$eval ionic.bundle.js:21516
Scope.$digest ionic.bundle.js:21328
Scope.$apply ionic.bundle.js:21620
(anonymous function) ionic.bundle.js:23127
completeOutstandingRequest ionic.bundle.js:13328
(anonymous function) ionic.bundle.js:13629
Error: Failed to execute ‘send’ on ‘XMLHttpRequest’: Failed to load ‘file:///C:/Users/vinay/Desktop/olx_ionic/templates/event-menu.html’.
at Error (native)
at file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:17405:11
at sendReq (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:17208:9)
at $http.serverRequest (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:16949:16)
at wrappedCallback (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20406:81)
at wrappedCallback (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20406:81)
at file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:20492:26
at Scope.$eval (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21516:28)
at Scope.$digest (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21328:31)
at Scope.$apply (file:///C:/Users/vinay/Desktop/olx_ionic/js/ionic.bundle.js:21620:24) ionic.bundle.js:18897
(anonymous function) ionic.bundle.js:18897
(anonymous function) ionic.bundle.js:16244
wrappedCallback ionic.bundle.js:20409
wrappedCallback ionic.bundle.js:20406
(anonymous function) ionic.bundle.js:20492
Scope.$eval ionic.bundle.js:21516
Scope.$digest ionic.bundle.js:21328
Scope.$apply ionic.bundle.js:21620
(anonymous function) ionic.bundle.js:23127
completeOutstandingRequest ionic.bundle.js:13328
(anonymous function)


#2

It is because of your server.


#3

server?
i am running that file by just clicking on index.html. for that any server is not needed?
i need proper solution.

thank you @siddhartha


#4

You need to put all project files on a server. For example this one: WAMP.
This is because “cross origin requests are only supported for HTTP”


#5

No, look at this answer: Ionic-demo app


#6

Follow this tuturial and works very well:
http://ionicframework.com/docs/guide/testing.html


#7

thank you i have solved this problem using python. thank you all of you guys. @siddhartha @axcs @mrnz