So, zuerst einmal ausgeführt. Es läuft auf einem anderen Webserver fein: http://colorsnatcher.com/cuse/feedback.htmlJavascript wird nicht ordnungsgemäß in PHP
wird hier nicht funktionieren: http://campusbasement.com/contact.php#
Als ich es in meiner Website implementieren möchten, ist das Javascript nicht ordnungsgemäß ausgeführt.
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>
Fehler:
contact.php:246Uncaught TypeError: Object #<an Object> has no method 'tabSlideOut'
EDIT: ich es herausgefunden. Es war im Konflikt mit anderen Skripten, anstatt $ zu verwenden, musste ich jQuery verwenden.
Was ist Ihre Frage? Was funktioniert nicht? Auch ich glaube nicht wirklich, dass es mit PHP zu tun hat - was in deinem Browser läuft ist das generierte HTML –
Was meinst du mit "läuft nicht richtig"? Welche Fehler oder unerwartetes Verhalten siehst du? – BenV
FireBug meldet: $ ("# slide-out-div"). TabSlideOut ist keine Funktion –