Here's another script that isolates the problem more.

There are 2 dependencies.... the first is having the prototype.js in
the same directory.  The second is having a file named msg.txt in the
same directory.  In my case, the text file just has the message, "Are
we having FUN yet?".

This works in Firefox, but not in IE.

-Ed



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="javascript" type="text/javascript"
src="prototype.js"></script>
<script language="javascript" type="text/javascript">

function HTTPRequest(url, params, methodType, callback) {
        new Ajax.Request(url, {
                asynchronous: true,
                method: methodType,
                parameters: params,
                onSuccess: function(request){ callback(request.responseText);
green();},
                onFailure: function(request) {
                        HTTPRequestError(url, request.responseText);
                }
         });
}

function green() {
        alert("green");
}

function box(stuff) {
        alert(stuff);
}

function HTTPRequestError(url, results) {
        alert("HTTP Request Error\nurl: " + url + "\nresults: " + results);
}

function test() {
//      alert("test");
        var callback = function(stuff){box(stuff);}
        HTTPRequest('msg.txt', '', 'get', callback );
}

function testSuccess(data) {
        alert("Success:  " + data);
}

</script>
</head>

<body>
<input type="button" value="Push Me" onClick="test()">

<p> </p>

</body>
</html>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to