• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 446
  • Last Modified:

Prototype & Scriptaculous - Ajax.Updater not working in IE but is in FF

Hi,

I am trying to dynamically update a div using Ajax.Updater. It works fine in FF but not in IE7. Any ideas? I thought it was a caching issue but apparently not (see random number generated in js call).

This is driving me insania!!

Cheers
Martin

script...

function changeContent(page)
{
var randomnumber = Math.floor(Math.random()*1000001)
var file = page + '.html?random=' + randomnumber;
new Ajax.Updater('content', file , { method: 'get' });
}

html....

<div id="leftheader">
</div>
<div id="rightheader">
</div>
<div id="menu">
</div>
<div id="content">
<div id="leftcol">
</div>
<div id="rightcol">
</div>
</div>
<div id="footer">
</div>


css...

body {
    margin: 0px;
      background:black;
    padding: 0px;
        font-family:Eurostile, Tahoma, Verdana;
      font-size:11px;
      color:gray;
}

#leftheader {
  background: black;
  width: 21em;
  float: left;
  padding-left:1em;
  height: 9em;
}

#rightheader{
  background: black;
  text-align:right;
  float: left;
  width: 44em;
  height: 9em;
  padding-top:1em;
}

#menu {
  background: black;
  width: 65em;
  padding-left:1em;
  height: 1.5em;
  clear: both;
  text-align:center;
}

#nocols {
  background: black;
  width: 65em;
  height: 26em;
  clear: both;
  padding-top:5em;
  padding-left:3em;
}

#leftcol {
  background: black;
  float: left;
  width: 38em;
  height: 26em;
  padding-left:3em;
  padding-top:5em;
}

#rightcol {
  background: black;
  float: left;
  width: 27em;
  height: 26em;
}

#footer {
  background: black;
  clear: both;
  width: 65em;
  height: 2em;
}
0
Scoobymib3
Asked:
Scoobymib3
  • 3
1 Solution
 
hieloCommented:
try:
function changeContent(page)
{
var r =(new Date()).valueOf();
var file = page + '.html?random=' + randomnumber;
new Ajax.Updater('content', file, {"method":'get',"parameters":{"random": r}} );
}
0
 
Scoobymib3Author Commented:
Cheers but that didn't work either unfortunately.
0
 
Scoobymib3Author Commented:
Tight timescale =(
0
 
Scoobymib3Author Commented:
Right it seems it was something to do with running it locally. Works fine when uploaded to the host
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now