Forum: Ruby on Rails AJAX on Mobile Internet Explorer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Daniel Völkerts (Guest)
on 2006-03-16 19:43
(Received via mailing list)
Hi!

I try to get AJAX running on a mobile Windows Mobile 5.0 based device
and failed. There should be a JavaScript support but nothing happens.
Have any of you experience with the rails javascripts on a this platform
or are there any hints, documentation on the net?

tia,
Daniel Völkerts (Guest)
on 2006-03-16 19:52
(Received via mailing list)
Daniel Völkerts schrieb:
[First post]
The docs on
http://msdn.microsoft.com/library/default.asp?url=...
said, that MIE supports JavaScript 5.6 (ECMA-Level 3) and a DOM based on
W3C's Document Object Model Level 0.

So, I'm not yet a JS guy, but I'll have to accompish this. Is there a
real chance to port the rails javascripts to this platform?

g,
Ben M. (Guest)
on 2006-03-17 09:36
(Received via mailing list)
Hmm, I think that's a typo... the current version of javascript is
1.6... unless M$ has
some whack-ass numbering scheme of their own. Anyway, I think your
problem is something
other than incompatible javascript versions. Try putting some simple
javascript into a
page and see if it works.

b
Chris H. (Guest)
on 2006-03-17 14:45
(Received via mailing list)
I know this doesn't fix your problem, but i'm doing some work with a
Windows
CE .NET 4.20 device and IE seems to work ok with the AJAX js I've used
so
far, although it is slow as mollasses as far as visual effects go (fade,
dragdrop, etc).  i probably wont use any effects for the pages accessed
by
this device.
Daniel Völkerts (Guest)
on 2006-03-17 16:56
(Received via mailing list)
Chris H. schrieb:
> I know this doesn't fix your problem, but i'm doing some work with a
> Windows CE .NET 4.20 device and IE seems to work ok with the AJAX js
> I've used so far, although it is slow as mollasses as far as visual
> effects go (fade, dragdrop, etc).  i probably wont use any effects for
> the pages accessed by this device.

Can you post an example? I tried this

<%= javascript_include_tag(:defaults) %>

<h1>Index of AJAX Demo</h1>
<%= link_to_remote 'Hallo Sagen',:update=> 'd1',
:url=>{:action=>'hello'}%>
<div id="d1">Test</div>

and turned on the Mobile Internet Explorer JS errorreporting in the ppc
registry. If I click on 'Hallo Sagen' I got an object (null) error (I
haven't the description on my side yet. I can post it later).

g,
Chris H. (Guest)
on 2006-03-17 18:40
(Received via mailing list)
well, i just did some tests...

apparently only the effects appear to work (draggable, etc), but
anything i
that does remote submission (link_to_remote, remote_form_tag) doesn't
work.
monitoring webrick shows no requests...but the page DOES work in IE and
firefox.  i'm not getting any javascript errors in CE however.

Chris
Gregory S. (Guest)
on 2006-03-17 18:49
(Received via mailing list)
On Fri, Mar 17, 2006 at 11:14:51AM -0500, Chris H. wrote:
} well, i just did some tests...
}
} apparently only the effects appear to work (draggable, etc), but
anything i
} that does remote submission (link_to_remote, remote_form_tag) doesn't
work.
} monitoring webrick shows no requests...but the page DOES work in IE
and
} firefox.  i'm not getting any javascript errors in CE however.

Sounds like XMLHttpRequest may not be available on the CE version of IE.
If
you have any kind of support relationship with Microsoft you might want
to
check on it. Also, if you give me the details (various software
versions) I
will consult my sources.

The results of the following HTML may be instructive as well:

<html><head><title>AJAX test</title>
<script>
var xhr = false;

function ajaxCallback() {
  alert("readyState = "+xhr.readyState);
  if (xhr.readyState == 4) {
    if (xhr.status != 200) {
      alert("HTTP request failed: status "+this.xhr.status);
    } else {
      alert("Request succeeded!");
      alert("Results:\n\n"+xhr.responseText);
    }
  }
}

function runTest() {
  try {
    xhr = new XMLHttpRequest();
    alert("Found a modern XMLHttpRequest object.");
  } catch (trymicrosoft) {
    alert("No modern XMLHttpRequest object. Trying new Microsoft.");
    try {
      xhr = new ActiveXObject("Msxml2.XMLHTTP");
      alert("Found a new Microsoft XMLHttpRequest object.");
    } catch (othermicrosoft) {
      alert("No new Microsoft XMLHttpRequest object. Trying old
Microsoft.");
      try {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
        alert("Found an old Microsoft XMLHttpRequest object.");
      } catch (failed) {
        xhr = false;
        alert("No XMLHttpRequest object is available.");
      }
    }
  }
  if (xhr != false) {
    alert("Trying a request to myself.");
    xhr.open("GET", ""+window.location, true);
    xhr.onreadystatechange = ajaxCallback;
    xhr.send(null);
  }
}

</script>
</head><body>
<h1>AJAX test</h1>
<form><input type="button" value="Run test" onClick="runTest()"></form>
</body></html>

} Chris
--Greg
Daniel Völkerts (Guest)
on 2006-03-17 18:49
(Received via mailing list)
Chris H. schrieb:

> work in IE and firefox.  i'm not getting any javascript errors in CE
> however.

Yes the error reporting is disabled by default, you have to put it on
with a registry key
CURRENT_USER\Software\Microsoft\InternetExplorer\Main

new dword ShowScriptErrors 1

g,
Daniel Völkerts (Guest)
on 2006-03-17 19:02
(Received via mailing list)
Gregory S. schrieb:

>       alert("HTTP request failed: status "+this.xhr.status);
>     alert("Found a modern XMLHttpRequest object.");
>       } catch (failed) {
>   }
> }
>
> </script>
> </head><body>
> <h1>AJAX test</h1>
> <form><input type="button" value="Run test" onClick="runTest()"></form>
> </body></html>
>
> } Chris

Sounds great. I'll give it a try tomorrow and will although post my
configuration and version info.
Chris H. (Guest)
on 2006-03-17 19:08
(Received via mailing list)
I haven't had to do anything to get script error dialogs when there is a
script error
Daniel Völkerts (Guest)
on 2006-03-17 19:18
(Received via mailing list)
Chris H. schrieb:
> I haven't had to do anything to get script error dialogs when there is a
> script error

What version are your running on? I've Windows Mobile 5.0 (Dell Axim X51
Xscale-ARM) incl. Windows Mobile Internet Explorer (version?!?). I
looked up MSDN to find that hack so my guess was that this is a generell
Windows Mobile 5 problem. There are no option pane which control that
behaviour.

g,
Chris H. (Guest)
on 2006-03-17 19:52
(Received via mailing list)
Greg,

Sure enough, IE on Windows CE does not apparently support any form of
XMLHttpRequest.  All tests failed.

Chris
Chris H. (Guest)
on 2006-03-17 20:06
(Received via mailing list)
honestly, i don't know much about the device, other than it runs Windows
CE
.NET 4.20 and the HTTP User Agent is reported as Mozilla/4.0
(compatible;
MSIE 6.0; Windows CE).  other than that, I don't know much else about
it.
The device is a PSION TEKLOGIX 7535 handheld scanner.
Chris H. (Guest)
on 2006-03-17 20:09
(Received via mailing list)
interesting bit of information

http://www.pocketpcdn.com/articles/xmlfaq.html
Gregory S. (Guest)
on 2006-03-17 20:22
(Received via mailing list)
On Fri, Mar 17, 2006 at 01:06:25PM -0500, Chris H. wrote:
} interesting bit of information
}
} http://www.pocketpcdn.com/articles/xmlfaq.html

Yeah, that's sort of what I thought. MSXML is what provides the
XMLHttpRequest object on IE, and it looks like the Pocket PC 2000
Standard
ediition doesn't include it. It looks like all later editions of Pocket
PC
or WinCE do, though.

--Greg
Chris H. (Guest)
on 2006-03-17 20:32
(Received via mailing list)
yeah, but my device is a Windows CE .NET 4.20 device but does not appear
to
have MSXML.
Gregory S. (Guest)
on 2006-03-17 20:45
(Received via mailing list)
On Fri, Mar 17, 2006 at 01:31:45PM -0500, Chris H. wrote:
} yeah, but my device is a Windows CE .NET 4.20 device but does not
appear to
} have MSXML.

According to that web page, and everything else I can find on the MSDN
site, you should have MSXML3, if not MSXML4. See if you can download it
or
if it's an optional component you didn't install or something.

--Greg

} On 3/17/06, Gregory S. <removed_email_address@domain.invalid> wrote:
} >
} > On Fri, Mar 17, 2006 at 01:06:25PM -0500, Chris H. wrote:
} > } interesting bit of information
} > }
} > } http://www.pocketpcdn.com/articles/xmlfaq.html
} >
} > Yeah, that's sort of what I thought. MSXML is what provides the
} > XMLHttpRequest object on IE, and it looks like the Pocket PC 2000
Standard
} > ediition doesn't include it. It looks like all later editions of
Pocket PC
} > or WinCE do, though.
} >
} > --Greg
} >
} > _______________________________________________
} > Rails mailing list
} > removed_email_address@domain.invalid
} > http://lists.rubyonrails.org/mailman/listinfo/rails
} >
Daniel Völkerts (Guest)
on 2006-03-18 12:36
(Received via mailing list)
Daniel Völkerts schrieb:
> Sounds great. I'll give it a try tomorrow and will although post my
> configuration and version info.

Here is my test result. Put the code from Chris into
rails\ajax\public\xhr.html and pointed my Mobile IE
to http://192.168.0.4:3000/xhr.html.

Loads without an error, mmm, that says that he evaled the JS propably,
right?

Know I click on the Button ... and failed due no modern XmlHTTPReq.
Object. Damned! Thanks for the testscript Chris I'll looking on the net
if we can install a MSXML package.

TIA,
Daniel Völkerts (Guest)
on 2006-03-18 12:36
(Received via mailing list)
Gregory S. schrieb:

> According to that web page, and everything else I can find on the MSDN
> site, you should have MSXML3, if not MSXML4. See if you can download it or
> if it's an optional component you didn't install or something.

Windows Mobile 5 hadn't it too. Try to install it at any way an post my
results. Thanks for the hint to the pocket community.
Daniel Völkerts (Guest)
on 2006-03-18 12:39
(Received via mailing list)
Daniel Völkerts schrieb:
> Gregory S. schrieb:
>
>> According to that web page, and everything else I can find on the MSDN
>> site, you should have MSXML3, if not MSXML4. See if you can download
>> it or
>> if it's an optional component you didn't install or something.
>
> Windows Mobile 5 hadn't it too. Try to install it at any way an post my
> results. Thanks for the hint to the pocket community.
Rejected, see above post.
Daniel Völkerts (Guest)
on 2006-03-18 12:39
(Received via mailing list)
Daniel Völkerts schrieb:

> Know I click on the Button ... and failed due no modern XmlHTTPReq.
> Object. Damned!

*lol* After I clicked away the error notice he reports that he found a
new MS XMLHttpRequest object. Great. So I could build up a simple AJAX
call?

g,
Daniel Völkerts (Guest)
on 2006-03-18 12:42
(Received via mailing list)
Ooh its not my run. The line xhr.open fails with 'Object doesn't support
this property or method'. My feelings are riding the waves... :(

Can any of you recommend a good JS book? I see that I've to dive into
this stuff or otherwise I'll going directly to hell ;)

g,
Daniel Völkerts (Guest)
on 2006-03-18 13:00
(Received via mailing list)
Daniel Völkerts schrieb:

> *lol* After I clicked away the error notice he reports that he found a
> new MS XMLHttpRequest object. Great. So I could build up a simple AJAX
> call?

Opera Mobile Beta 2 works with the xhr testscript from above! Will know
try the other rails ajax calls.
Daniel Völkerts (Guest)
on 2006-03-18 15:53
(Received via mailing list)
Daniel Völkerts schrieb:
> Daniel Völkerts schrieb:
>
>> *lol* After I clicked away the error notice he reports that he found a
>> new MS XMLHttpRequest object. Great. So I could build up a simple AJAX
>> call?
>
> Opera Mobile Beta 2 works with the xhr testscript from above! Will know
> try the other rails ajax calls.
>
>

Only to complete and close this thread. Opera works on Pocket PC with
AJAX/Rails.
This topic is locked and can not be replied to.