php - Server not reading jquery -
i created application using php, mysql, , jquery. it's working fine on localhost,m after uploading server, works fine jquery, believe it's not reading it.
using firebug, following error when trying read .js file in browser:
uncaught syntax error: unexpected token.
here's how include scripts:
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="js/autoresize.jquery.js"></script> <script type="text/javascript" src="js/customselect.jquery.js"></script> <script type="text/javascript" src="js/jquery.form.js"></script> <script type="text/javascript" src="js/jquery.validate.js"></script> <script type="text/javascript" src="js/jquery.validate.password.js"></script>
i did check files , exist in /js/ . wrong?
update
it working when read : https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
but it's not working when reading server?
you using relative path right now.
when use relative path, requests go path relative location.
for example, if on http://www.mysite.com/products/catalog.php
, browser send request jquery scripts location: http://www.mysite.com/products/js/
not exists.
try using absolute path instead. in fact make habit of!
try following:
<script type="text/javascript" src="/path/to/your/srcipt/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="/path/to/your/srcipt/autoresize.jquery.js"></script> <script type="text/javascript" src="/path/to/your/srcipt/customselect.jquery.js"></script> <script type="text/javascript" src="/path/to/your/srcipt/jquery.form.js"></script> <script type="text/javascript" src="/path/to/your/srcipt/jquery.validate.js"></script> <script type="text/javascript" src="/path/to/your/srcipt/jquery.validate.password.js"></script>
Comments
Post a Comment