Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder tylerjca's Avatar
    Join Date
    Dec 2002
    Location
    Canada
    Posts
    162
    Thanks
    1
    Thanked 0 Times in 0 Posts

    innerHTML problem... won't go :S

    NEVERMIND! [SOLVED]

    original post:

    I'm trying to use AJAX to run a script that would append a <div>

    the problem, is that when new data is available, it doesn't add it to the <div>

    here's the code that's *supposed* to work:
    Code:
    var answer = request.responseText;
    answer = answer.split("#split#");
    document.getElementById('msgs').innerHTML += answer[0];
    document.getElementById('debug').value += answer[0];
    however, it won't append it to the 'msgs' <div> but it WILL append it to the textarea with the id of 'debug' ...

    when I alter the code to:
    Code:
    var answer = request.responseText;
    answer = answer.split("#split#");
    document.getElementById('msgs').innerHTML += answer[0];
    alert(anwer[0]);
    document.getElementById('debug').value += answer[0];
    ... it works just fine (appends the data to the <div>), but it of course gives an alert box with the same data!

    What's going on with Javascript??
    Please help
    Last edited by tylerjca; 11-11-2006 at 08:29 PM. Reason: solved it!


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •