-
20 Jan 2013 7:19 AM #1
Unanswered: Adding new CSS to app.json file
Unanswered: Adding new CSS to app.json file
Hi,
I am trying to add some custom css to my application, and from what i've read , the best way si to add the css to my app.json file.
After doing this, the Chrome Debugger returns the following error:
My app.json css array looks like this:Code:Uncaught SyntaxError: Unexpected token ILLEGAL
Do I have to recompile or something using sencha cmd, after modifying the css array ?Code:{ /** * List of all CSS assets in the right inclusion order. * Each item is an object with the following format: * { * "path": "path/to/item.css" // Path to file, if local file it must be relative to this app.json file * "remote": true // (Optional) * // - Defaults to undefined (falsey) to signal a local file which will be copied * // - Specify true if this file is a remote file which will not to be copied * "update": "delta" // (Optional) * // - If not specified, this file will only be loaded once, and * // cached inside localStorage until this value is changed to either one below * // - "delta" to enable over-the-air delta update for this file * // - "full" means full update will be made when this file changes * * } */ "css": [ { "path": "resources/css/app.css", "update": "delta" }, { "path": "resources/css/myCssStyle.css", "update": "delta" } ] .... }
After removing my css from the array everything works fine.
Thank you for your help.
-
20 Jan 2013 10:26 AM #2
-
21 Jan 2013 5:10 AM #3
I'm pretty sure the problem is due to the incorrect json file format.
You probably forgot to open / close quotes somewhere.
Try to look deeper, and if you will not find anything wrong, I suggest you to remove all the comments from the file, and validate it using jsonlint, it will find the error for you.Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
21 Jan 2013 6:32 AM #4
The app.js file has been generated using the Sencha Cmd, so there couldn't be any errors.
The problem appears only after I insert my css statement into the array. If I remove it, everything works fine.
As you can see in the above example, there are no typos in the CSS array.
Thank you,
Alex
-
21 Jan 2013 6:38 AM #5
Even if that was generated using Sencha Cmd, you have edited it manually so there could be some errors / invisible chars which invalidate the json structure.
I'm not able to see if there are errors from what you posted because that is only a part of the json file, not the whole.
Did you tried to validate it using jsonlint?
I have no errors adding a new css file to the mentioned array.Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata


Reply With Quote