Picture of Александр 5600
Registered 3 years 220 days
Александр 5600 Tuesday, 21 September 2021, 12:50 PM
Problem with access to own library files in HTML
I am developing an application and I needed to add my CSS and JS libraries to the project.

I copied the libraries folders to the project: APPWEBPATH = My_Project / apps

Next, I added APPWEBSRC_ZIP + = \ $ (APPWEBPATH) /css/net_med/NetMed.css \ to the apps.mak file

In the HTML file I added <link rel = "stylesheet" type = "text / css" href = "/ css / net_med / NetMed.css" />

In Visual Studio Solution Explorer, I added the required files to the project.

Rebuilt the solution, but the HTML page doesn't see my css file.

In the console http://192.168.135.45/css/net_med/NetMed.css is not available.

Logically, my css file should be at the address for example http://192.168.135.45/My_Project/13A495/css/net_med/NetMed.css

What do I need to do in the mak file or elsewhere so that I can link to my files, and not the files in the project root folder or on framework / sdk / web?
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 121 days
Daniel Deterding (innovaphone) Tuesday, 21 September 2021, 01:28 PM
Re: Problem with access to own library files in HTML
Your apps.mak seems to be fine.
But your HTML file shouldn't use an absolute href, but must use a relative href:

<link rel="stylesheet" type="text/css" href = "css/net_med/NetMed.css" />

This relative link is added to your absolute URI http://192.168.135.45/My_Project/13A495/

I tested this locally right now and it worked with subfolders too.

Greetings,
Daniel
← You can define your color theme preference here