치료를 위해 작동하는 PHP 페이지가 있으며 맨 위에 일부 JavaScript가 있습니다. 즉 HEAD 태그 사이에 있습니다. 내 PHP는 "header ("location :/");" 임의의 지점에서 다시 사용자를 index.php로 리디렉션하는 코드. 나는 자바 스크립트의 한 부분으로 헤더 정보 오류를 수정할 수 없다는 것을 좁혔다.JavaScript가 원인 인 헤더 정보를 수정할 수 없습니다. PHP의 오류
나는 HTML이 다른 것보다 먼저 출력되기 때문에 오류가 발생한다는 것을 알고 있습니다. 그러나 JavaScript를 읽거나 이해하는 방법을 모릅니다. 누군가 내가 내가 할 수 있거나 바꿔야하는 것에 나를 가리킬 수 있습니까?
<script type="text/javascript">
$(document).ready(function(){
//jCarousel Plugin
$('#carousel').jcarousel({
vertical: true,
scroll: 1,
auto: 2,
wrap: 'last',
initCallback: mycarousel_initCallback
});
//Front page Carousel - Initial Setup
$('div#slideshow-carousel a img').css({'opacity': '0.5'});
$('div#slideshow-carousel a img:first').css({'opacity': '1.0'});
$('div#slideshow-carousel li a:first').append('<span class="arrow"></span>')
//Combine jCarousel with Image Display
$('div#slideshow-carousel li a').hover(
function(){
if (!$(this).has('span').length){
$('div#slideshow-carousel li a img').stop(true, true).css({'opacity': '0.5'});
$(this).stop(true, true).children('img').css({'opacity': '1.0'});
}
},
function(){
$('div#slideshow-carousel li a img').stop(true, true).css({'opacity': '0.5'});
$('div#slideshow-carousel li a').each(function(){
if ($(this).has('span').length) $(this).children('img').css({'opacity': '1.0'});
});
}
).click(function(){
$('span.arrow').remove();
$(this).append('<span class="arrow"></span>');
$('div#slideshow-main li').removeClass('active');
$('div#slideshow-main li.' + $(this).attr('rel')).addClass('active');
return false;
});
});
//Carousel Tweaking
function mycarousel_initCallback(carousel){
// Pause autoscrolling if the user moves with the cursor over the clip.
carousel.clip.hover(function(){
carousel.stopAuto();
}, function(){
carousel.startAuto();
});
}
</script>
이 자바 스크립트 안에 PHP 코드가 없습니다. 이 코드는 PHP 파일 내에서 가지고있는 코드와 완전히 똑같습니까? 아니면 PHP 페이지의'view-source'를 수행 한 후 위의 코드를 복사 했습니까? –