How can I clean an html container before adding new information html to it? - Forum

Forum Navigation
You need to log in to create posts and topics.

How can I clean an html container before adding new information html to it?

Hi all !

Please, I don´t know how to leave a container empty of html information to introduce new information so that the old one does not remain residual.

Spanish:

Hola a todos,  mirad, no consigo vaciar un container de información a través de codigo html y dejarlo limpio para volver a introducirle información nueva y no arrastre tambén a la antigua información de manera residual.

Me explico mejor con un ejemplo, esto es lo que hay en un botón al hacer click entre otros muchos comandos:

Loop 0 ([itembus1]-1) [v]
GetObjectHTML "imprimir" [html]
StrParse "[sevanbus1([v])]" "|" [temparray]
SetObjectHTML "imprimir" "[html][temparray(0)]<br>"
EndLoop

Este proceso me funciona a las mil maravillas, pero cuando quiero actualizar con información nueva y elimine la antigua que hay en el container lo que hace es que añade a lo que hay antiguo lo nuevo.

Dentro del container solo hay este codigo html , concretamente este:

<div id='imprimir' style='column-count: 2; column-width: 50px;column-rule-style: solid;column-rule-color: #ff0000;'></div>

de tal manera que lo que se asigna a" imprimir"  se cumple a la perfección pero cuando quiero actualizar de nuevo con otra información me queda residual la antigua.

He intentado limpiar el objeto virtual "imprimir" con el comando RemoveObject pero lo que hace es que ya no aparece ni la nueva ni la antigua información.

Gracias y espero haber sido claro en lo que he querido expresar.

 

 

@joaquinfdez

I don't know how to leave a container empty of html information to introduce new information so that the old one does not remain residual.

SetObjectHTML "print" ""
ignore this ... I can not delete it
luishp has reacted to this post.
luishp

@joaquinfdez lo que describes que sucede es lo que has programado. En ningún sitio vacías la información preexistente, por lo que siempre estás añadiendo la nueva a la que ya había. Para solucionarlo simplemente pon una línea como esta justo antes de entrar en el Loop:

SetObjectHTML "imprimir" ""

Saludos!

JoaquinFDEZ has reacted to this post.
JoaquinFDEZ

If previously-loaded data "hangs" in a container and won't unload, this may be of help:

 

OnDocumentReady

Purpose:

The document ready event occurs when the DOM (document object model) has been loaded and it's saFe to use any script over any object.

This command executes a given subroutine once the document ready event occurs.

Category:

Events

Syntax:

OnDocumentReady "subroutine name"

subroutine name

The name of the subroutine to execute when the document is ready.

Example:

OnDocumentReady "MySubroutine"