2012年7月25日 星期三

jQuery not work on php?

If you are developer,find the jQuery not work on your project,maybe the resaon here.

A lot of teach website will show that example in HTML head
<script language="JavaScript" src="JQuery/jquery-1.7.2.min.js"></script>

Project/yourcode.php  call jquery-1.7.2.min.js by this command:


yourcode.php direct in Project


Project->Project/JQuery->Project/JQuery/jquery-1.7.2.min.js 


That's fine, but if your code path is

Project/otherwise/yourcode.php

yourcode.php direct in Project/otherwise 

Project/otherwise could not find the same "floor".
it will search JQuery/jquery-1.7.2.min.js
Project/otherwise/...

so your should use the code path like this:
<script language="JavaScript" src="../JQuery/jquery-1.7.2.min.js"></script>
it will redirect

Project/otherwise->Project->Project/JQuery->Project/JQuery/jquery-1.7.2.min.js 



沒有留言:

張貼留言