I have a laravel app, to which I am now trying to add functionality provided by surveyJS.
So the standard laravel (v5.6) Authentication QuickStart puts this into the view/layouts/app.blade.php view
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
And then I want to add in the survey JS scripts, and the JQuery on which it depends. So I do this:
<!-- Scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://surveyjs.azureedge.net/1.0.28/survey.jquery.min.js"></script>
<script src="{{ asset('js/app.js') }}" defer></script>
Now it does not seem to matter where I put ...('js/app.js')...
in the order of things, it's mere existance causes the surveyJS scripts to not work. Specifically, the survey form is shown, but the button actions no longer work.
EDIT
...('js/app.js')...
is required for the laravel header menu dropdowns- jQuery is needed for the surveyJS functionality
- The chrome dev console shows no errors.
- The chrome dev network shows all three scripts loading in the order shown above, as expected.
So...
- When ...('js/app.js')...
is in, then laravel menu's work, surveyJS doesn't.
- When ...('js/app.js')...
is removed, then laravel menu's don;t work, but surveyjs does.
EDIT #2 Now further investigation shows that within th BODY tags, this div is the culprit.
<body>
<div id="app">
....
</div>
</body>
If I remove that specifi DIV element, then my javascripts work, although I do a get a one line warning ni my console app.js:36520 [Vue warn]: Cannot find element: #app
- of course - I removed it.
app.js
by the way seems to be 47,000+ lines of code related to "webpackBootstrap". Installed by default with laravel auth quickstart - not my creation.
I've gone with what I hope is a simple approach, being a simple JQuery and thus avoiding any additional complexity of React/Angular/Vue.
What should I be looking at?