javascript html type question
Discussion
i am writing to a cell characters from two different arrays.
ideally i would like to be able to insert a break in between the text from the two arrays
array1 = ("1","2"
array2 = ("A","B"
;
writing to the cell would like it to appear or at least how i imagine it would work
cells[c].write(array1[1] + <br> + array2[1]
1
A
putting the + in just turns the <br> into a string anyone else done this or can point me in the direction of how to do what i am attempting?
cheers,
ideally i would like to be able to insert a break in between the text from the two arrays
array1 = ("1","2"
array2 = ("A","B"
; writing to the cell would like it to appear or at least how i imagine it would work
cells[c].write(array1[1] + <br> + array2[1]
1
A
putting the + in just turns the <br> into a string anyone else done this or can point me in the direction of how to do what i am attempting?
cheers,
If you're writing this in Javascript then the page isn't going to reload (it's client based) - so writing a <br> tag to the page won't create the line break you wish for as the html isn't re-parsed for the tag to be read and the space placed.
Thats if I udnerstand correctly what you're trying to do.
IF you want to do this in jscript you need an object within the page that you can write to directly. E.g. a form / div etc... In fact possibly one easy way to do this is to have two DIV's one above the other and write output for first array to diva, then output from array to to divb...
OR if you want to put in a carriage return / line feed then it's ascii 10 / 13 (e.g. Chr(13) / Chr(10) ) etc
>> Edited by mr_tony on Thursday 16th February 16:53
Thats if I udnerstand correctly what you're trying to do.
IF you want to do this in jscript you need an object within the page that you can write to directly. E.g. a form / div etc... In fact possibly one easy way to do this is to have two DIV's one above the other and write output for first array to diva, then output from array to to divb...
OR if you want to put in a carriage return / line feed then it's ascii 10 / 13 (e.g. Chr(13) / Chr(10) ) etc
>> Edited by mr_tony on Thursday 16th February 16:53
These little examples should help you out:
alert("Hello World!"
;
alert("Hello <br>World!"
;
alert("Hello World!"
;
Balls - my code is so good even this forum does it!
What I'm trying to say is put a backslash n between Hello and World will make it appear on a new line.
>> Edited by slapmatt on Friday 17th February 11:08
alert("Hello World!"
; alert("Hello <br>World!"
; alert("Hello World!"
; Balls - my code is so good even this forum does it!
What I'm trying to say is put a backslash n between Hello and World will make it appear on a new line.
>> Edited by slapmatt on Friday 17th February 11:08
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


