Just finished the phoenix tutorial and now trying some things out. First: add a selectionlist to the header of the ‘welcome’ screen. I downloaded the twitter dropdown.js + jquery and put them in priv/static/js, edited brunch-config.js to load jquery first and put something like
in web/templates/layout/app.html.eex . It did not work as expected after I started phoenix.server, so I wanted to remove the js files from priv/static/js. To my surprise they had been removed already, two other js files were generated in their place. Ok, then remove those. I removed the changes from brunch-config.js and web/templates/layout/app.html.eex. Restarted phoenix.server. Chrome caching is disabled. But still I get an error about dropdown.js missing jquery when navigating to the welcome screen, in chrome. In the chrome console I can still see dropdown.js + jquery. Are there more places where I have to remove / change things?
Btw fun to see my html translated (in the previous message).
//<a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1
//<li><a href="#">Page 1-1</a></li>
//<li><a href="#">Page 1-2</a></li>
//<li><a href="#">Page 1-3</a></li>
As @chrismccord pointed out to me a few days ago: The proper place to add JS files to is
web/static/js for things you want Brunch to compile and add to your
web/static/assets/js for things you want to copy over 1:1 without changes. This second place is where you can add libraries like
dropdown.js. Both of these folders will end up in the root folder
To add static files to your application, add a line like
<script src="<%= static_path(@conn, "/js/filename.js") %>"></script> to your template file(s).
Thanks, I will try that. But in the meanwhile: how do I get rid of the mess that I obviously have now? I thought I cleared everything.