谷歌chrome开发工具显示404错误,但该文件存在,可以在开发工具中直接点击


Google chrome dev tools says 404 error, but the file is present and can be clicked right in dev tools!

我已经在两个站点上安装了这个脚本。在我的本地主机站点中,它运行良好。然而,在我的第二个测试站点上,下面的脚本在color.php文件上返回了一个404错误(在Chrome的开发者控制台中)。

尽管如此,我可以点击控制台中的color.php,它加载良好,echo的值是我期望的正确值。我不知道是什么导致了404,但它阻止了脚本访问doColor()函数中的alert()。有什么想法吗?

$('#my_theme').change
(
    function() 
    {
    $("#largePreview").hide();
    var myImage = $('#my_theme :selected').text();
    $('.selectedImage img').attr('src','<?php echo get_bloginfo('template_directory') ?>/styles/'+myImage+'/screenshot.jpg');
    $('.selectedImage img').attr('title',myImage);
    $.get('<?php echo get_bloginfo('template_directory') ?>/color.php', {theme: myImage, spot: '1'}, function(data){doColor('#my_theme_header_color', data);});
    $.get('<?php echo get_bloginfo('template_directory') ?>/color.php', {theme: myImage, spot: '2'}, function(data){doColor('#my_theme_sidebar_color', data);});
    $.get('<?php echo get_bloginfo('template_directory') ?>/color.php', {theme: myImage, spot: '3'}, function(data){doColor('#my_theme_spot_color_alt', data);});
    $.get('<?php echo get_bloginfo('template_directory') ?>/color.php', {theme: myImage, spot: '4'}, function(data){doColor('#my_theme_spot_color_alt2', data);});
    }
);
function doColor(el, color)
    {
    alert('in function docolor');
    $(el).val(color).trigger('keyup');
    $(el).attr('value', color);
    $(el).val(color);
}

color.php的内容如下。。。

<?php
require_once('../../../wp-blog-header.php');
$myTheme = $_REQUEST['theme'];
$spot = $_REQUEST['spot'];
$myThemeColor = $myTheme."_color".$spot;
$myColor = get_option($myThemeColor);
$file = "styles/".$myTheme."/template.ini";
if ($myColor == "") 
{
    if (file_exists($file) && is_readable($file))
    {
    $ini_array = parse_ini_file($file);
     if($spot == 1){$myColor = $ini_array['color1'];}
     if($spot == 2){$myColor = $ini_array['color2'];}
     if($spot == 3){$myColor = $ini_array['color3'];}
     if($spot == 4){$myColor = $ini_array['color4'];}
    }
    else
    {
     if($spot == 1){$myColor = get_option('cb2_theme_header_color');}
     if($spot == 2){$myColor = get_option('cb2_theme_sidebar_color');}
     if($spot == 3){$myColor = get_option('cb2_theme_spot_color_alt');}
     if($spot == 4){$myColor = get_option('cb2_theme_spot_color_alt2');}
    }
}
echo $myColor;
?>

听起来您的web服务器不知道第二个测试服务器上的文件。

可能是权限设置。

您使用的是什么平台和web服务器?