What should be the paths to files added to insertCSS (), relative?

I start with a phone call and find that the documents on this issue are slightly different.

When I use insertCSS()in my current project , it seems that any way I use, css is not used.

As you can see from this link, my file structure is:

app-root
|
...
|_ www
    |
    |_ css
    |   |
    |   target.css
    |
    |_ js
    |   |
    |   index.js
    |   
    index.html

In index.js, I make an insertCSS () call in the event listener for inAppBrowser.

This function should pull target.css:

iab.addEventListener('loadstop', function() {
    // Once loaded, add css
    iab.insertCSS( { file: "target.css" } );
});

But it is not

I tried several different relative file paths, for example css/target.cssand ../css/target.css, but they don't seem to work.

What am I missing?

+1
source share
1

CSS .

( GitHub):

iab.insertCSS( { code: "body { background-color: green; }" }, function(){
  iab.insertCSS( { code: "body { background-color: green; }" } );

:

iab.insertCSS( { file: "../css/chat.window.css" }

. :

  • ( )
  • ( )
+1

Source: https://habr.com/ru/post/1543684/


All Articles