I' m a very happy user of PureBasic and I want to know if is it possible to insert SpiderBasic code into an exhisting html file made by another program (Dreamweaver for example). I imagine two ways of inserting the SpiderBasic code:
1) There is a rectagle area in the html page that it's a SpiderBasic Window
2) The background of the html page it's a SpiderBasic Window with #PB_Window_Background flag.
I failed in both of these two way.
When I try to mix html elements and spiderbasic elements on the same page the browser first shows the html elements then redraw the page and shows only the spiderbasic elements. I tried to move the <div class="flat" id="spiderbody"> in a different position (inside the <body> tag for example) but I had no success.
I haven't found an example with this integration. All the included examples only contains html elements that are totally made by SpiderBasic.
Any suggestion?
Thanks in advance
Alberto
How to insert SpiderBasic code into an exhisting html file?
- SparrowhawkMMU
- Posts: 281
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
Re: How to insert SpiderBasic code into an exhisting html fi
You might be able to use an <iframe>
for example:
You can then use the contentDocument peoprerty of the iframe to manipulate it via the DOM, eg (Javascript from parent doc)
PS - not tested, but in principle this should work. It's adapted fomr a W3C example so should be OK
for example:
Code: Select all
<iframe id="myiframe" src="http://my-spiderbasicsite.com"></iframe>
Code: Select all
var myframe = document.getElementById("myiframe");
var mydoc = (myframe.contentWindow || myframe.contentDocument);
if (mydoc.document) {
mydoc = mydoc.document;
}
mydoc.body.style.backgroundColor = "powderblue";
Re: How to insert SpiderBasic code into an exhisting html fi
Thank you SparrowhawkMMU.
I've tested it and works good.
This is what I was looking for.
Thanks again
Alberto
I've tested it and works good.
This is what I was looking for.
Thanks again
Alberto