Re: [問題] include~

看板Ajax作者 (芋頭)時間16年前 (2008/07/19 01:23), 編輯推噓3(305)
留言8則, 3人參與, 最新討論串2/2 (看更多)
那我先將我有問題的code貼上來 以下檔直接複製貼上就可以執行了 B檔: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "" rel="nofollow">http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="" rel="nofollow">http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("#myList").sortable({}); }); </script> <style>ul { list-style: none; } li { background: #727EA3; color: #FFF; width: 100px; margin: 5px; font-size: 10px; font-family: Arial; padding: 3px; }</style> </head> <body> <script src="" rel="nofollow">http://dev.jquery.com/view/tags/ui/latest/ui/ui.core.js"></script> <script src="" rel="nofollow">http://dev.jquery.com/view/tags/ui/latest/ui/ui.sortable.js"></script> <ul id="myList"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> </ul> </body> </html> C檔: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "" rel="nofollow">http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="jquery-1.2.6.min.js"></script> <script> $(document).ready ( function(){$('#example').datepicker();} ); </script> <style> #clock{ padding-left:620px; padding-top:10px; } </style> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>無標題文件</title> </head> <body> <link rel="stylesheet" href="http://dev.jquery.com/view/tags/ui/latest/themes/flora/flora.datepicker.css" type="text/css" media="screen" title="Flora (Default)"> <script src="" rel="nofollow">http://dev.jquery.com/view/tags/ui/latest/ui/ui.datepicker.js"></script> <div id="clock"> <input type="submit" id="example" value="C a l e n d a r" style="width:120px; height:35px; "> </div> </body> </html> A檔: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "" rel="nofollow">http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>無標題文件</title> </head> <body> <? include "test.php"; ?> <? include "clock.php"; ?> </body> </html> ----------------------------------------------------------------------- B檔的Item可以自由拖移變動位置 C檔則是行事曆 個別執行都可以 但是用A檔include兩個檔案就會導致B檔的拖移功能消失了= =" 我的問題是為什麼拖移消失了!? 謝謝大家~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.139.147.63

07/19 01:28, , 1F
js的部份我沒有去研究 但是這樣直接include 整個html的結構
07/19 01:28, 1F

07/19 01:30, , 2F
都不對了 建議把<head>和<body>裡的內容分開來插入 B和C也
07/19 01:30, 2F

07/19 01:31, , 3F
要去掉不必要的部份...etc 總之不能這樣直接include啦 = =
07/19 01:31, 3F

07/19 01:32, , 4F
你用瀏覽器的檢視原始碼去看看這樣出來變成什麼東西了..Orz
07/19 01:32, 4F

07/19 01:43, , 5F
唔....原Po可能需要找一下HTML基礎教學看一看
07/19 01:43, 5F

07/19 01:47, , 6F
我的口氣可能有點急躁 不過這問題真的是蠻基礎的地方就錯了
07/19 01:47, 6F

07/19 01:50, , 7F
恩恩 謝謝~我會再去研究一下
07/19 01:50, 7F

07/19 02:00, , 8F
已經解決了 謝謝回答的各位~
07/19 02:00, 8F
文章代碼(AID): #18WD6J7M (Ajax)
討論串 (同標題文章)
文章代碼(AID): #18WD6J7M (Ajax)