How to load Javascript and CSS files in Webview.?

Hi Everyone, I want to make an HTML Game in kodular, and I have HTML, CSS, and JS files for this but I don’t know how to upload this file in kodular. and how to set up this block for this?

So please help me @kodular_teams :pray: :pray:

1 Like

try this

or use built in component

1 Like

you can dynamically add stylesheet link into webviewer using javascript

var link = document.createElement('link'); 
link.rel = 'stylesheet'; 
link.type = 'text/css';
link.href = 'https://demowebsite/stylesheet.css'; 
document.getElementsByTagName('HEAD')[0].appendChild(link);

Replace https://demowebsite/stylesheet.css with your stylesheet (css) link

2 Likes

Can you show this block.?

blocks(7)

1 Like

ok, I’m trying this. but can I replace https://demowebsite/stylesheet.css to my CSS file name, Because I have a CSS file and not loaded to CSS any link.

My problem is solved, I am using Taifun Extension and call PathToAssest.

Thanks, Everyone!!

1 Like

to read a html file in the assets using the webviewer, you now also can use this path
http://localhost/index.html
Taifun

2 Likes

And to read an html file that is NOT in the assets. With fenix 1.5.2 it seems impossible.

try to create a small example project as small as possible and add it into your thread, so someone can check

Taifun

I already did and I don’t get a response.
Will it be fenix 1.5.2 webview problem?
If this is so, we will have to wait.
Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.