[Pas2js] dataTransfer has a rare performance!??

Pedro Pablo Oviedo Vera verakuba13 at gmail.com
Fri Aug 23 21:04:47 CEST 2019


it;s works....thanks!!!

Saludos
pp

El jue., 22 ago. 2019 a las 2:48, Michael Van Canneyt (<
michael at freepascal.org>) escribió:

>
>
> On Wed, 21 Aug 2019, Pedro Pablo Oviedo Vera wrote:
>
> > Hello people,...yes, me again....look:
> >
> > ..if in a function like :
> > function Arrastrar(aEvent:TJSDragEvent): Boolean;
> > begin
> >  aEvent.dataTransfer.setData('Text','<img src="'+
> > FOrg1.getAttribute('src')+'" >');
> > end;
> >
> >
> > with FOrg1.getAttribute('src') >> '/synapse/synapse_logo.gif'
> >
> > ...and later:
> >
> > function Soltar(aEvent:TJSDragEvent):Boolean;
> > begin
> >   FDest.innerHTML:= aEvent.dataTransfer.getData('Text');
> >   aEvent.preventDefault;
> > end;
> > ...
> > why FDest.InnerHTML just shows '/synapse/synapse_logo.gif' instead of
> <img
> > src="/synapse/synapse_logo.gif" > ??
> >
> > any idea?
>
> Try logging aEvent.dataTransfer.getData('Text') in your Soltar event. I
> suspect that because you use Text, it transforms whatever is inside the
> data
> to plain text. If so, try using 'text/html' instead of Text.
>
> Michael.
> _______________________________________________
> Pas2js maillist  -  Pas2js at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js
>


-- 

MSc. Ing. Pedro Pablo Oviedo Vera
Dirección Técnica y Desarrollo
Empresa de Proyectos e Ingeniería del
Ministerio de la Agricultura.ENPA.
Boyeros y Conill, Piso 10 Edif MINAG
Telef. 884 7197
SIP:23000116
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20190823/5135dfd3/attachment.html>


More information about the Pas2js mailing list