IEMobile 7.11与外部的Javascript? [英] IEMobile 7.11 with external Javascript?

查看:78
本文介绍了IEMobile 7.11与外部的Javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm trying to work with a windows mobile 6.1 device running IEMobile 7.11 and I'm trying to load external javascript as such:

我试图使用运行IEMobile 7.11的windows mobile 6.1设备, C $ C>< HTML>
< head>
< script type =text / javascriptsrc =js / alert.js>< / script>
< / head>
< body><?php echo('< pre>);的print_r($ _ SERVER);回波(< /预>); ?>< /体>
< / html>

<html> <head> <script type="text/javascript" src="js/alert.js"></script> </head> <body><?php echo('<pre>'); print_r($_SERVER); echo('</pre>'); ?></body> </html>

alert.js看起来像这样:

alert.js looks like this:

alert('this is included javascript');

目前没有出现,但是如果我将javascript拖入实际的HTML页面,它可以正常工作。这是iemobile的一个已知问题吗?我似乎无法在周围找到很多关于谷歌..或者我做错了什么?

Currently this is not appearing, however If i pull the javascript into the actual HTML page it works fine.. Is this a known issue with iemobile? I can't seem to find much on google around it.. or am I doing something wrong?

预先感谢您。

推荐答案

我怀疑是对原始海报的有用回应太迟了,但我最近遇到了同样的问题。最终我发现IEMobile没有执行JavaScript文件,因为服务器正在用'application / javascript'内容类型发送文件。
虽然这是JavaScript文件的正确MIME类型,并且它适用于早期版本的IEMobile(假定完全忽略它),但某些版本如果IEMoblie7.11显然无法识别它。

Too late to be a useful response to the original poster I suspect, but I recently encountered the same problem. Eventually I figured out that IEMobile wasn't executing the JavaScript file because the server was sending the file with an 'application/javascript' content-type. While that's the correct mime-type for JavaScript files, and it works on earlier versions of IEMobile (which presumably ignore it entirely) some versions if IEMoblie7.11 apparently don't recognise it.

更改您的Web服务器以将JavaScript文件作为application / x-javascript发送似乎可以解决此问题。作为一个更老的标准,我猜'text / javascript'也可以,但我没有自己尝试过。

Changing your web server to send JavaScript files as 'application/x-javascript' seems to fix the problem. Being an older standard, I'd guess 'text/javascript' would also work, though I didn't try it myself.

这篇关于IEMobile 7.11与外部的Javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆