How to load index.html contents in Xojo

Hi,

I have a html(index.html) having JavaScript code which is able to draw Chart on webpage.
It works fine when I tried to run it directly from web URL.

I’m trying to use WebSDK to use that html in Xojo.
In MyHTMLArea1, I tried to insert the total contents of the html into Me.HTML. But got a lot of syntax error and so on.
I think this method is wrong to load index.html contents in Xojo.

Can I use the index.html contents directly by using the Me.HTML = string… ?

I just wanted to load index.html result in HTMLArea through Xojo code.

Thanks in advance.

Have a look at https://forum.xojo.com/11937-d3-js-charts-with-xojo-desktop-app/0 .

Oh.Great.
I’m going to go over it. It seems that it is using HTMLViewer of Desktop Xojo.
I thought it is impossible so I have been thinking of WebSDK to use a JavaScript Chart!

Thanks.

I’m afraid the way mentioned in the Forum doesn’t seem to be proper to my requirements.
For getting the database data, I’m using PHP so I need PHP interpreter that’s why I built a small webserver.
The way I launch the index.html is as follows.

http://localhost:8080/index.html

Actually, I’m also using JavaScript Chart library.
I would like to know how I can run the index.html easily through WebSDK.

What exactly are you trying do do? It sounds very complicated :slight_smile:

I just want to make a JavaScript Chart(AmChart like d3.js) on web page.

Index.html : load data.php & Functions to draw AmChart
data.php : get database data and generates Json format data.
Webserver : loading index.html

When I run index.html in the web url, it works fine and I can see a beautiful Chart.

Here, I’m trying to make a dashboard with several Charts, that’s why I’m considering to use Xojo WebSDK.
My main application is a Desktop version.
Just will show Charts on Web page.

Sorry to say that it looks complicated.

Thanks.

I’m not sure why you want to use php when the goal are Javscript charts. Can you do the php part in Xojo instead and then use the method of d3 for the Javascript?

OK. It makes sense.
I will try to remove PHP and make Json data through Xojo.

Thanks.

[quote=197283:@changwon lee]Hi,

I have a html(index.html) having JavaScript code which is able to draw Chart on webpage.
It works fine when I tried to run it directly from web URL.

I’m trying to use WebSDK to use that html in Xojo.
In MyHTMLArea1, I tried to insert the total contents of the html into Me.HTML. But got a lot of syntax error and so on.
I think this method is wrong to load index.html contents in Xojo.

Can I use the index.html contents directly by using the Me.HTML = string… ?

I just wanted to load index.html result in HTMLArea through Xojo code.

Thanks in advance.[/quote]

You could try to put the Index.html code into a pageSource loaded before content. It should display just fine onto your web page.