Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bit of a tricky question

Status
Not open for further replies.

DigitalBoy

Programmer
Oct 11, 2000
87
US
Fellow Developers:

Here is a small problem that I am working on right now. If anyone has any quick solutions, please let me know. Thanks.

GOAL - Create code that will take a variable(s) and dynamically write them as the contents of a table cell. For example, consider the following:

.
.
<tr>
<td><b>[DYNAMICALLY GENERATED ASCII TEXT]</b></td>
</tr>
.
.

PROBLEM - I know that once you close the stream to a client, the page can no longer be written to (at least in JS1.2 which is what I must adhere to.) So how would something like this be done? Oh, I forgot to mention: I am using this same code to control the same app on a different platform that DOES permit post-close screen drawing, so I have to take both situations into account.

- DB Web Developer
Digital Video Arts, LTD.

AIM: dgtlby
ICQ: 68300740
 
well you could use spans:

your function would be something like:
Code:
function outPut(textString) {

  isNS =(document.layers);
  syntax = (isNS) ? document.layers.outPut.document : outPut.innerHTML;

  if (document.layers) {
    syntax.write(textString);
    syntax.close();
  else if (document.all) {
    syntax = textString;
  }
}

then in your table:

Code:
<tr>
 <td><b><span id=&quot;ouput&quot; style=&quot;position: relative&quot;></b></td>
</tr>
-Greg :-Q
 
sorry, the function should be:
Code:
function outPut(textString) {

  isNS =(document.layers);
  syntax = (isNS) ? document.layers.outPut.document : outPut.innerHTML;

  if (isNS) {
    syntax.write(textString);
    syntax.close();
  else if (!isNS) {
    syntax = textString;
  }
}
[code]

accually it should really matter, it just looks better -Greg :-Q
 
wow i messed up twice..there is a brace missing..this should (technically) work
Code:
function outPut(textString) {

  isNS =(document.layers);
  syntax = (isNS) ? document.layers.outPut.document : outPut.innerHTML;

  if (isNS) {
    syntax.write(textString);
    syntax.close();
  } else if (!isNS) {
    syntax = textString;
  }
}
ok that should be my last post..lol -Greg :-Q
 
Greg -

thanks for all the advice... Actually, I solved my own answer before I left work, but I have yet to be able to impliment it.

- DB Web Developer
Digital Video Arts, LTD.

AIM: dgtlby
ICQ: 68300740
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top