PDA

View Full Version : Prototype - Ajax.Updater "Hello World' working in Firefox and Safari, not in IE


mjmetzger
02-24-2008, 10:45 PM
Hey all,
I'm lost. I've got a project using Prototype 1.6.0 that works works great in firefox and even friggin' Safari 3 for Windows, but for some strange reason it will not work in Internet Explorer (IE7 specifically). I've stripped my code down to the core and realized I can't even get a basic Hello World example to work in IE.

Assume we have a really lame hello world site that contains default.htm, hello.htm, and prototype.js (inside a folder named 'js'). On this site we have a link with a mouseover event that makes a request to hello.htm and puts the response inside of the 'ResponseContainer' div. Sounds simple enough... Here's what I've got.

default.htm:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/prototype.js"></script>
</head>
<body>
<a href="#"
onmouseover="new Ajax.Updater(
'ResponseContainer',
'hello.htm',
{method:'get'});">Say Hello</a>
<div id="ResponseContainer"></div>
</body>
</html>


And Only Because I am completely lost I will include the hello.htm code:

hello.htm:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/prototype.js"></script>
</head>
<body>
<p>hello</p>
</body>
</html>


Any help would be appreciated. I feel so stupid.

mjmetzger
02-24-2008, 11:01 PM
I see when I post my Hello World example onto the server it works in IE... So this example works and my other example doesn't. Life sucks sometimes! (half kidding). I have another post.

Prototype - Ajax.Request works in FF, IE throws Error Message: Unknow runtime Error

Jenita
02-12-2009, 01:14 PM
It may be because of Ajax caching which is present in Internet Explorer.

Try this link :

http://sameera-programming.blogspot.com/2009/01/ajax-not-working-in-internet-explorer.html

ohgod
02-16-2009, 02:23 PM
use post instead of get