AJAX Help Please

Discussion in 'JavaScript' started by live-cms_com, Oct 9, 2008.

  1. #1
    I am working on a site, and a part of the site is like the Digital Point keyword tool - www.marketingcpanel.com. I am having a problem with IE. I am doing asynchronous AJAX requests and in Firefox everything works fine, but it IE is pretty much freezes until the requests are done.

    Log in as demo//demo and click 'Refresh' on the 'Keyword Tracker' module in Firefox to see what it's meant to do. Try it in IE as well to see the problem.

    Any ideas why it temporarily freezes in IE instead of change the innerHTML of the status bar?

    edit: my code uses xmlHttp.open("GET",url,false);, which is actually synchronous?
     
    live-cms_com, Oct 9, 2008 IP
  2. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yep, your request is synchronous. Change the third parameter to 'true' to make it asynchronous.

    P.S. Can't test it with IE, cause I don't have any Windows around, but on Firefox it crashes too. This is what error console says about the issue:
     
    xlcho, Oct 9, 2008 IP
  3. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #3
    Yeah, I was trying to work around it by using asynchronous, but that is giving me even bigger problems.

    My code runs 'xmlHttp.open("GET",url,true); xmlHttp.send(null);' 5 times, but 'if(xmlHttp.readyState==4){' is only reached 4 times.....
     
    live-cms_com, Oct 9, 2008 IP
  4. qprojects

    qprojects Peon

    Messages:
    1,901
    Likes Received:
    103
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I would suggest you to use a javascipt library like jQuery if possible. It makes writing/debugging scripts a lot faster. :)
    http://docs.jquery.com/Ajax/jQuery.get
    If you need any help with this, do let me know.
     
    qprojects, Oct 9, 2008 IP
    live-cms_com likes this.
  5. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #5
    I have been recommended that a few times, I should probably start listening. :rolleyes:

    Actually, this was very, very helpful. I only used it for the HTTP requests, but that was the only JS causing me problems. :D

    I had one more problem with IE, but I found it to be a caching problem, which I fixed through a PHP header().
     
    live-cms_com, Oct 9, 2008 IP
  6. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #6
    me would say something about using mootools making more sense than jquery but it's a matter of personal choice. whatever does the job done. and there are about .... oh dunno, at last official count on ajaxian.com - 260+ AJAX frameworks out there.
     
    dimitar christoff, Oct 9, 2008 IP
  7. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #7
    The digitalpoint keyword tool is dead for everyone else, right? As you can see, there's an alternative in the works. ;) And it feels way faster than DPs tool too, except that I'm limited to 32 results per keyword...thanks to Google's crappy API.
     
    live-cms_com, Oct 9, 2008 IP