...

View Full Version : innerHTML problem... won't go :S



tylerjca
11-11-2006, 05:56 PM
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:


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:


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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum