Question

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:

<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 looks like this:

alert('this is included javascript');

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?

Thank you in advance.

Was it helpful?

Solution

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.

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.

OTHER TIPS

I'm trying to work with a windows mobile 6.1 device running IEMobile 7.11

I'm so sorry for you.

Well, there are a million things wrong with IEMobile<8, but one thing it just about can do is include JavaScript from an external file.

Is that one line really the only thing in the file? Have you checked there's no extraneous crud in it, like a UTF-8-encoded faux-BOM saved by some idiotic Windows text editor? Do other browsers load the script OK?

Have you enabled script errors? Many standard DOM methods that every browser since Netscape 4 has supported still fail on IEMobile<8 and you will have no chance of debugging anything on the foul thing if it silently swallows errors.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top