Copy link to clipboard
Copied
Hello,
I'm trying to get an external JS sheet on my webpage to actually do what I want it to do and it's as if it just ignores it.
1) I've attached the JS sheet to the <head> section and using the full link of the following
<script type="text/javascript" src="../JS Documents/bookCastingJS.js"></script>
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
Doesn't work, so I used single commas instead of the default double quotation marks, & shock horror, still doesn't work. Is it just me or is this he most ridiculous programme I've ever worked with? Why am I coding exactly from a tutorial on Stack Overflow which works on perfectly, but it doesn't bother work on DW?
2) Giving up on that, I decided to put the JS code into the HTML webpage under the <script> tags & would you believe it, still doesn't want to play ball.
Its a computer programme, its not a disobedient child. If it works in one programme I expect it to work in any other programme I use. I should not have to waste my time on these forums asking for help just because my JS file can't be bothered to work on DW.
I use Edge as a browser by the way.
Any valid reason as to why this might be?
If <script type="text/javascript" src="../JS Documents/bookCastingJS.js"></script> is dependant on the jQuery library, then jQuery should be loaded first.
You have called three different jQuery libraries, namely
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
That is enough to conf
...Copy link to clipboard
Copied
If <script type="text/javascript" src="../JS Documents/bookCastingJS.js"></script> is dependant on the jQuery library, then jQuery should be loaded first.
You have called three different jQuery libraries, namely
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
That is enough to confuse anyone let alone a poor computer. Remove two of those libraries.
Copy link to clipboard
Copied
What Ben said is absolutely correct. The order in which scripts load is very important. Never use more than 1 jQuery core library.
To add one more thing, jQuery 3.x is the very latest stable release however it might be too advanced for older plugins. An old plugin might work better with jQuery 2.x or 1.x.
Nancy
Copy link to clipboard
Copied
You should also place the bookCastingjs file after the jQuery file, if it is written in jQuery.
If your browser downloads or executes that file, before the jQuery file is downloaded and executed the browser will throw errors on the bookCasting code. You can easily check if this is the reason, or if it is a coding problem by using the dev console in Edge, to checking the network loading sequence for file loading and using the de-bugger for coding errors.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now