Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

cordova - Failed to load webpage with error: Frame load interrupted

I see this has been asked before but I dont see any solutions:

So Im using Cordova 2.5 to build an iPad app on iOS 6.1.2

My app.coffee:

jQuery ->
    class window.AppRouter extends Backbone.Router
        routes: {
            '': 'index',
            ':parent/:child/': 'childView',
            ':id/': 'detailView',
        },

        index: =>
            $("#navbar .title").text("Flight Centre's Choices")
            view = new fc.main.View
            view.render()

        childView: (parent, child) =>
            view = new fc.main.View(parent:parent, child:child)
            view.render()

        detailView: (id) =>
            view = new fc.main.Detail(id:id)
            view.render()

    window.app = new AppRouter();
    Backbone.history.start();

The first index view loads successfully and displays as it should

Now clicking on one of the links to lets say open childView, it fails to load the page:

2013-03-20 16:56:13.684 Flight[1158:907] Resetting plugins due to page load.
2013-03-20 16:56:13.689 Flight[1158:907] Resetting plugins due to page load.
2013-03-20 16:56:13.694 Flight[1158:907] Failed to load webpage with error: Frame load interrupted

the link the user clicks on looks like this':

/#/foo/bar/

Everything works as expected in Chrome browser on my mac.

I dont know whats happening here!!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Damn this waisted allot of time, the answer was so dumb and simple.

Rather than having the links in the html as :

/#/foo/bar/

It should just be

#/foo/bar/

this makes sense, with the leading / the page will reload, and thats why I got that error.

Hope it helps someone


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...