Connecting Tech Pros Worldwide Help | Site Map

Question about innerHTML

  #1  
Old July 23rd, 2005, 08:07 PM
Adonis
Guest
 
Posts: n/a
The code provided works as it should on IE, but not in FF.
I have tried most of what I can think of, being new to JavaScript.

I have tried createElement/createTextNode/appendChild lingo, also
document.write(...) and all work for IE, but not FF, something I am missing?

Any help is greatly appreciated.

Adonis

[snip]

<body>
<div id="patient">
<script type="text/javascript">
getURL('GET', '/patient/list', getPatientList);
var divPatient = document.getElementById("patient");
for (var i = 0; i < patientList.length; i++)
divPatient.innerHTML = divPatient.innerHTML + patientList[i] + "<br
/>";
</script>
</div>
</body>
  #2  
Old July 23rd, 2005, 08:07 PM
mkpdev@gmail.com
Guest
 
Posts: n/a

re: Question about innerHTML


Firefox comes with a nice little JavaScript console (&Tools: JavaScript
&Console). Chances are you have an error with your getURL function.
(You might consider learning about the += operator.)

  #3  
Old July 23rd, 2005, 08:07 PM
RobB
Guest
 
Posts: n/a

re: Question about innerHTML


mkpdev@gmail.com wrote:[color=blue][color=green]
>> Adonis wrote:
>> The code provided works as it should on IE, but not in FF.
>> I have tried most of what I can think of, being new to JavaScript.
>>
>> I have tried createElement/createTextNode/appendChild lingo, also
>> document.write(...) and all work for IE, but not FF, something I am[/color][/color]
missing?[color=blue][color=green]
>>
>> Any help is greatly appreciated.
>>
>> Adonis
>>
>> [snip]
>>
>> <body>
>> <div id="patient">
>> <script type="text/javascript">
>> getURL('GET', '/patient/list', getPatientList);
>> var divPatient = document.getElementById("patient");
>> for (var i = 0; i < patientList.length; i++)
>> divPatient.innerHTML = divPatient.innerHTML + patientList[i] +[/color][/color]
"<br[color=blue][color=green]
>> />";
>> </script>
>> </div>
>> </body>[/color][/color]
[color=blue]
> Firefox comes with a nice little JavaScript console (&Tools:[/color]
JavaScript[color=blue]
> &Console). Chances are you have an error with your getURL function.
> (You might consider learning about the += operator.)[/color]

....or the Array.join() method... #;=)

document.write(patientList.join('<br>'));

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about a select list? (code attached) Italio Novuas answers 3 June 27th, 2008 08:12 PM
Question about createTextNode in xml files DKM answers 11 July 23rd, 2005 09:59 PM
Simple question about cross-window dropdown list loading Joseph Barron answers 1 July 20th, 2005 09:56 AM
Question about createTextNode in xml files DKM answers 11 July 20th, 2005 09:42 AM