所以,首先。它運行在另一個網站服務器罰款: http://colorsnatcher.com/cuse/feedback.htmlJavascript將無法正常運行在PHP
不會在這裏工作: http://campusbasement.com/contact.php#
當我想落實到我的網站,javascript的運行不正常。
Contact.php
<?php include('feedback.php'); ?>
feedback.php
<script src="http://www.campusbasement.com/scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="http://www.campusbasement.com/scripts/tab.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://www.campusbasement.com/feedback/feedback.css" type="text/css" />
<script type="text/javascript">
$(function(){
$("#slide-out-div").tabSlideOut({
tabHandle: '#handle', //class of the element that will become your tab
pathToTabImage: 'http://www.campusbasement.com/feedback/report.png', //path to the image for the tab //Optionally can be set using css
imageHeight: '160px', //height of tab image //Optionally can be set using css
imageWidth: '40px', //width of tab image //Optionally can be set using css
tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left
speed: 300, //speed of animation
action: 'click', //options: 'click' or 'hover', action to trigger animation
topPos: '200px', //position from the top/ use if tabLocation is left or right
leftPos: '20px', //position from left/ use if tabLocation is bottom or top
fixedPosition: true //options: true makes it stick(fixed position) on scroll
});
});
</script>
<div id="slide-out-div">
<a id="handle" href="#"><div id="reportImage"></div></a>
<div id="contactform">
<form method="post" action="http://www.campusbasement.com/feedback/contactengine.php">
<input id='name' name='name' type='text' placeholder="Name" > <br />
<input id='Email' name='Email' type='text' placeholder="Email" > <br />
<br />
<textarea name="Message" rows="5" cols="15" id="Message" placeholder="Bugs? Suggestions?"></textarea><br />
<input type="submit" name="submit" value="Submit" class="submit-button" />
</form>
</div>
</div>
錯誤:
contact.php:246Uncaught TypeError: Object #<an Object> has no method 'tabSlideOut'
編輯: 我想通了。它與其他腳本衝突,因此而不是使用$,我不得不使用jQuery。
你的問題是什麼?什麼不行?另外我真的不認爲它與PHP有關 - 瀏覽器中運行的是生成的HTML – 2010-11-18 21:35:55
「無法正常運行」是什麼意思?你看到什麼錯誤或意外的行爲? – BenV 2010-11-18 21:36:37
FireBug報告:$(「#slide-out-div」)。tabSlideOut不是函數 – 2010-11-18 21:36:39