views:

18

answers:

1

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.

+1  A: 

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.

bobince
Thanks for the response. Yes Other browsers have worked fine with it, enabled script errors (nothing). At this point I have created a simplified version which uses no javascript so that the crappy IE Mobile device can work.. What a pain! Thank you for your response :)
Frederico
I'd be interested in seeing a test case for what's not working. IEMobile certainly can load scripts in general, though it's incredibly limited about what those scripts can actually do. Having a site work without JS at all is always best though (progressive enhancement et al)!
bobince