Jump to content


Photo

jquery works in FF not IE?


  • Please log in to reply
3 replies to this topic

#1 derek.sullivan

derek.sullivan

    Jedi In Training

  • Members
  • PipPip
  • 343 posts
  • Gender:Male
  • Location:Georgia
  • Interests:preaching, programming, music, friends, outdoors, moves, books

Posted 31 March 2011 - 10:26 AM

For some reason, this code only works in FF and not in IE... It will post, reload in FF but it does not reload in IE only posts:

Jquery file:
$(document).ready(function() {

$("#messages").load('messages.php');

$("#form").submit(function() {

var string = $("#form").serialize();

$.ajax({

type: 'POST' ,
url: 'process.php' ,
data: string ,
success: function() { $("#messages").load('messages.php'); $("#message").val(''); }

});

return false;

});

setInterval(function() {

$("#messages").load('messages.php');

}, 1000);

});

Edited by derek.sullivan, 11 April 2011 - 03:44 PM.


#2 Demonslay

Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 973 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 21 April 2011 - 09:37 PM

I suspect this quote from the jQuery.load() documentation could be related.

jQuery uses the browser's .innerHTML property to parse the retrieved document and insert it into the current document. During this process, browsers often filter elements from the document such as <html>, <title>, or <head> elements. As a result, the elements retrieved by .load() may not be exactly the same as if the document were retrieved directly by the browser.


Try using FireBug and FireBug Lite to see what your response from the calls to jQuery.load() is, and compare them from each browser; it could shed some light on what is going on. :)

#3 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 21 April 2011 - 11:48 PM

Try using $.ajaxSetup() to set the cache parameter to false. I know some browsers have some pretty agressive caching when it comes to AJAX (i can't remember if i'm thinking of IE or FF).

Note: i'm not sure $.ajaxSetup() affects $.load(), but it's worth a try (or at least some more research).

Edited by rc69, 21 April 2011 - 11:49 PM.


#4 derek.sullivan

derek.sullivan

    Jedi In Training

  • Members
  • PipPip
  • 343 posts
  • Gender:Male
  • Location:Georgia
  • Interests:preaching, programming, music, friends, outdoors, moves, books

Posted 26 April 2011 - 07:06 PM

okay, I'll do some research tonight when I get home on what you've suggested. Thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users