jQtouch webapp 在 mac Safari 上运行良好,但在 iPhone Safari 上无法运行
这是我的第一个 Web 应用程序,我按照 Jonathan Stark 的 Building iphone apps with HTML, css and javascript 开发了这个应用程序。即使我选择“开发”>“开发”,在我的 mac safari 上测试一切正常。用户代理>移动 Safari...您可以在您的 Safari 中查看上述网站,并看到它工作正常。
然而,当我最终(以为我已经)完成了所有事情并查看了我的 iPhone safari 中的内容时,整个世界崩溃了……事情太混乱了。
我正在使用 jQtouch,我以某种方式意识到这可能是因为我从 JSON 文件中提取数据...因为如果我从本地存储中提取数据(如收藏夹和组合),它可以正常工作,没有任何问题。但是,如果它从 JSON 中提取数据,那么它会变得一团糟...
我的 JSON 文件位于此处:
http://hongteetrading.com/demos/pronouncecn/lib/names.json
用于拉取数据的 javascript:
$.getJSON("lib/names.json",function(data) {
$.each(data.names,function(i,val){
if(val.spelling==id){ ... }
我想还有更好的方法吗?或者你在 jQtouch 中使用哪种数据交换格式?
This is my first web app and I developed this one by following Jonathan Stark's Building iphone apps with HTML, css and javascript. Everything was testing ok on my mac safari, even when I select Develop > User Agent > Mobile Safari... You can view the above site in your safari and see it's working fine.
However when I finally (thought I had) finished everything and view stuffs from my iPhone safari, the whole world collapsed... Things are so messed up.
I'm using jQtouch and I somehow get an idea that it might because I'm pulling data from JSON files... Because if I pull data from the local storage (like favorites and combination), it's working fine without any issue. However if it's pulling data from JSON, then it'll turn into a mess...
My JSON file is located here:
http://hongteetrading.com/demos/pronouncecn/lib/names.json
The javascript used for pulling data:
$.getJSON("lib/names.json",function(data) {
$.each(data.names,function(i,val){
if(val.spelling==id){ ... }
I guess there could be any better ways of doing it? Or what kind of data-interchange formate you're using with jQtouch?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在执行其他操作之前,您应该先修复 HTML 中的一些错误。使用 W3C 服务查看它们:
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fhongteetrading.com%2Fdemos%2Fpronouncecn%2F%23home
一旦这些错误被修复,你将有更好的机会找到设备之间呈现不同的特定内容,因为您将遵守标准。
There are few errors in your HTML that you should fix before you do anything else. Use the W3C service to review them:
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fhongteetrading.com%2Fdemos%2Fpronouncecn%2F%23home
Once those errors are fixed you will have a better chance of hunting down the specific things that are rendering differently between devices because you'll be conforming to standards.