views:

52

answers:

2

Hello. I have this ajax_update script that updates file.php every 60 seconds.. Now file.php outputs this after updated a table:

<div id="message" style="display: none;" onclick="closeNotice()">this works
</div>

What I am trying to do is that after file.php have updated a field in the database(points), there will come up a message like stackoverflow at the top(just like when you earn a badge) saying that you have received 1 point. anyway:

Here's my update script:

function addpoints()  { 
  var postFile = 'addpoints.php?userid='+ $('#user_id_points').val();
  $.post(postFile, function(data){
    $("#points").html(data).find("#message").fadeIn("slow")
    setTimeout(addpoints, 5000);
  });
}  

Now, i have in my index.php, and a load function addpoints script..

But why will this only appear in FF and not in IE?

I have checked with w3c validator, if it could be unclosed tags or something, i fixed all problems and now i have no errors, but still it doesnt work.

So what to do?

You can see my site here: http://azzyh.dk/newgen/area/member/indextest.php

(use FF and you will see the message at the top, use IE and you wont see anything)

Im pretty lost. thank you

+2  A: 

Other browsers can be more forgiving of errors in your files than IE. IE will encounter an error and simply stop processing. By default, it will not notify you. Here is your error:

Message: Expected ')' Line: 41 Char: 243 Code: 0 URI: http://azzyh.dk/newgen/area/member/indextest.php

If you run Firebug, you will see Firefox report the same error as well.

Plynx
Any browser will encounter an error and stop processing.
metrobalderas
But IE stops processing *everything*, not just that code block.
Plynx
Hi plynx, i solved the problem but still not appearing in IE
Karem
Your next error is this one, which is hidden because you don't have an error handler in your $.post:`"could not complete the operation due to error c00ce56e"`If you google that you see it's a character set encoding problem. In some cases it can be resolved by setting your headers properly, e.g. UTF-8 instead of utf8. In PHP you might try commenting those lines out: `//$charset="utf-8";//header("Content-Type: text/html; charset=\".$charset.\""); `
Plynx
Thank you plynx!! this worked well, and it now appears in IE!!
Karem
Awesome! For the future in debugging with IE, always have that F12 (developer tools) up to see the hidden errors, and in JQuery, and put an error handler for your AJAX commands (even if it's just an alert). This will save you tons of time looking for mystery failures.
Plynx
A: 
<body onload="MM_preloadImages('images/index_01.gif',... ,'images/index_10.gif, ...">

Missing closing quote for index_10.gif image.

Qwerty
Hi, i fixed this, but it still doesn't appear in IE.
Karem