Connecting Tech Pros Worldwide Help | Site Map

Question about innerHTML

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 07:07 PM
Adonis
Guest
 
Posts: n/a
Default Question about innerHTML

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, 07:07 PM
mkpdev@gmail.com
Guest
 
Posts: n/a
Default 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, 07:07 PM
RobB
Guest
 
Posts: n/a
Default 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>'));

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.