I have this code
<head> <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"> </script> <script type="text/javascript" src="future_value.js"> </script> <script> $(document).ready(function() { $("button").click(function() { $("#popup").toggle(); }); }); </script>
I have some jQuery code and some JavaScript code, but I’m not able to run it. It seems like the way I’m including the files is incorrect, because when I delete the JavaScript tag the jQuery is working fine, and when i delete the JQuery tag the JavaScript is working.
I’m probably missing something. Thanks
You files are conflicting. Whoever wrote
future_value.jsis using the$as a function in their code. So does jQuery, so they are conflicting with one another. You have a couple options here:If future_value.js is short enough, do a search and replace all
instances of
$with something likefv.Use jQuery noConflict http://api.jquery.com/jQuery.noConflict/ and there after use
jQuery()instead of$()for all your jQueryoperations