Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

jquery - phonegap, connection to server unsuccessful

I'm trying to write an Android app with phonegap, and I'm writing a static front page with buttons, which was working until I introduced jQuery mobile and jQuery (which are linked as external files). Now, it gives me this error message (after it produces a blank window for 30 seconds or so):

Connection to server was unsuccessful to "www/assets/index.html"

Since the message flashes away, I cannot read anymore. Any help?

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

What exactly do you mean by "linked as external files"?

The jQuery Mobile and jQuery sources either need to be in the assets/www directory or linked to externally on an accessible cdn site with wireless or mobile data enabled.

There's an example here.

Also, see JQuery Mobile + PhoneGap for Android - Error loading index.html - Within your custom Activity file before calling super.loadUrl add the following line: super.setIntegerProperty("loadUrlTimeoutValue", 60000);


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...