<meta http-equiv="X-UA-Compatible" content="IE=edge" />This works for somethings and not for others. Not sure about Canvas/SVG support.
>Declare Integer BringWindowToTop In user32 Integer >Declare Integer SetWindowText In user32 Integer HWnd, String lpstring >Declare Integer Sleep In kernel32 Integer >local apie >apie=Newobject("internetexplorer.application") >apie.Navigate("about:blank") >sleep(500) > >With apie.Document >ycanvas = .createElement("canvas") >With ycanvas > .Id = "ycanvas1" > .Width=800 > .Height=700 > .Style.position = "absolute" > .Style.Border = "1px solid" > .Style.zIndex="100" > .style.background="gray" > Endwith > .body.appendChild(ycanvas) > Endwith > > sleep(2000) > >With apie > >*drawings from vfp here >Local oo,canvas,ctx >canvas=.Document.getElementById("ycanvas1") >canvas.Style.background="bisque" >*Messagebox( trans(canvas.width)+" "+trans(canvas.height)) >ctx=canvas.getContext("2d") >ctx.beginPath() > >ctx.lineWidth=5 >ctx.arc(100,100,80,0,2*Pi()) >ctx.strokeStyle="red" >ctx.stroke() >ctx.FillStyle="yellow" >ctx.Fill() > >gradient=ctx.createLinearGradient(0,0,170,0) >gradient.addColorStop("0","magenta") >gradient.addColorStop("0.5","green") >gradient.addColorStop("1.0","red") > >ctx.translate(200,0) >ctx.strokeStyle=gradient >ctx.lineWidth=5 >ctx.strokeRect(20,20,150,100) >************************** >ctx.translate(-100,0) >ctx.Font="22px Georgia" >ctx.FillStyle="green" >ctx.fillText("Hello World! VFP",0,180) >************************ > gradient=ctx.createLinearGradient(0,0,170,0) > gradient.addColorStop("0","magenta") > gradient.addColorStop("0.5","green") > gradient.addColorStop("1.0","red") > >* Fill with gradient >ctx.FillStyle=gradient >ctx.lineWidth=5 >ctx.fillRect(20,210,150,100) > >****************************** >*javascript from here >TEXT to m.myvar noshow >var canvas=document.getElementById("ycanvas1"); >ctx=canvas.getContext("2d"); > >ctx.translate(-100,350); >ctx.beginPath(); >ctx.lineWidth="5"; >ctx.arc(100,100,80,0,2*Math.PI); >ctx.strokeStyle="red"; >ctx.stroke(); >ctx.fillStyle="yellow"; >ctx.fill(); > >var gradient=ctx.createLinearGradient(0,0,170,0); >gradient.addColorStop("0","magenta"); >gradient.addColorStop("0.5","green"); >gradient.addColorStop("1.0","red"); > > ctx.translate(200,0); > ctx.strokeStyle=gradient; > ctx.lineWidth=5; > ctx.strokeRect(20,20,150,100); >////////////////////////// >ctx.translate(-100,0); >ctx.font="22px Georgia"; >ctx.fillStyle="green"; >ctx.fillText("Hello World! Javascript ",0,200); >///////////////////////// >gradient=ctx.createLinearGradient(0,0,170,0); >gradient.addColorStop("0","magenta"); >gradient.addColorStop("0.5","green"); >gradient.addColorStop("1.0","red"); >// Fill with gradient >ctx.fillStyle=gradient; >ctx.lineWidth=5; >ctx.fillRect(20,210,150,100); >ENDTEXT > > With apie.Document > x=.createElement("SCRIPT") > x.Id="yscript" > T =.createTextNode(m.myvar) > x.appendChild(T) > .body.appendChild(x) >Endwith >Sleep(2000) > >.menubar=0 >.Toolbar=0 >.StatusBar=0 >.Height=680 >.Width=800 >.Left=(Sysmetric(1)-.Width)/2 >.Visible=.T. >BringWindowToTop(.HWnd) >SetWindowText(.HWnd, "Html5 canvas from VFP and from Javascript") >Endwith >>