Link HTML Files from Assets

Hey Koders, So I’ve 3 files namely index.httml, style.css, script.js Now I’ve uploaded it to kodular assets file and loading it. First question How do I link script.js and style.css file in index.htm file what will be the src.
Second how do I run a parameters if I use index.html file from assets
for e.g if i host this then I can call https://mydomain.com?getKey=7263193&other parameters=xhagabdh
Thank You

As the files in the assets are in the same directory you might have to adjust the html file accordingly

Same, for example

http://localhost/index.html?getKey=7263193&otherparameters=xhagabdh

Taifun

load url using join blocks like file:///kodular/assets/ as text and join index.html file. this might work. Try it

The correct path to access a file index.html stored in the assets for the webviewer is

Taifun

Thank you so much it’s working

Wanted to ask a question uploading html,css,js file in kodular assets is good or hosting on a web server which is better. P.s I don’t care if anyone decompile app and found html file from there. Please suggest me

You do not need internet to access it and it is faster

In the assets your file is more protected than in the internet

Taifun

1 Like

Thank you @Taifun again. You’re the best

Hey earlier I was testing with a basic html,css, and js file. Now I’ve wrote all my final index.html file 2 css files, 2 script files.I’ve also set Enable Javascript,autoplay to true I’ve uploaded them to kodular assets. the Problem is when I’m using in companion, only the html code is loading and not style or js file( I know because there is no style and if the js file runs it return a getKey parameter in currentURL like
http://localhost/index.html?getKey=key123) but when i exported the apk I can see styled page for a slight second and then vanished and Says

404 Not Found

also as i mentioned earlier if javascript run it generates myKey parameter in currentURL(I used getCurrentURL block in a label) and I got it in currentURL it means js is running too.
http://localhost/index.html?myKey=key1234

Also i ran my earlier basic html,css,js files it was working perfectly fine in both companion as well as apk.
Here is the code in my main index.html body section

<script src="script1.js></script>
<script src="script2.js></script>

in index.html head section

<link rel="stylesheet" href="http://localhost/css1.css">
<link rel="stylesheet" href="http://localhost/css2.css">

Thank You

Which means, something is not correct in your main project

This looks fine

Taifun

I don’t think so because it work perfectly fine when i host it on web and load from their.