magento ajax在前端不工作

magento ajax在前端不工作,ajax,magento,Ajax,Magento,我创建的块路径是:local\Attribute\Layout\Controllers\ProductController代码是 类属性\u布局\u产品控制器扩展了Mage\u核心\u控制器\u前端\u操作 { } 在etc/config.xml中 <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Attribute_Layout> <versio

我创建的块路径是:local\Attribute\Layout\Controllers\ProductController代码是

类属性\u布局\u产品控制器扩展了Mage\u核心\u控制器\u前端\u操作 {

}

在etc/config.xml中

<?xml version="1.0" encoding="UTF-8"?>

<config>

<modules>
    <Attribute_Layout>
        <version>0.0.1</version>
    </Attribute_Layout>
</modules>

<global>
    <blocks>
        <attribute_layout>
            <class>Attribute_Layout_Block</class>
        </attribute_layout>
    </blocks>
</global>
<frontend>
    <routers>
        <layout>
            <use>standard</use>
            <args>
                <module>Attribute_Layout</module>
                <frontName>layout</frontName>
            </args>
        </layout>
    </routers>
    <layout>
        <updates>
            <attribute_layout module="Attribute_Layout">
                <file>attribute_layout.xml</file>
            </attribute_layout>
        </updates>
    </layout>
</frontend>
</config>
<?xml version="1.0"?>
<config>
<modules>
    <Attribute_Layout>
        <version>0.0.1</version>
    </Attribute_Layout>
</modules>
<frontend>
    <routers>
        <layout>
            <use>standard</use>
            <args>
                <module>Attribute_Layout</module>
                <frontName>layout</frontName>
            </args>
        </layout>
    </routers>
    <layout>
        <updates>
            <layout>
                <file>attribute_layout.xml</file>
            </layout>
        </updates>
    </layout>
</frontend>
<global>
    <blocks>
        <layout>
            <class>Attribute_Layout_Block</class>
        </layout>
    </blocks>
</global>
</config>

0.0.1
属性\布局\块
标准
属性布局
布局
属性_layout.xml
和design\frontend\default\shirt\u cust\layout\attribute\u layout.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">

<default>
<attribute_layout_product_ajaxData>
       <block type="layout/product" name="root" output="toHtml" template="attribute_layout/product.phtml" />
</attribute_layout_product_ajaxData>    

</default>

</layout>
<?xml version="1.0"?>
<layout version="0.0.1">
    <layout_product_ajaxData>
       <block type="layout/product" name="root" output="toHtml" template="attribute_layout/product.phtml" />
    </layout_product_ajaxData>
</layout>

在design\frontend\default\shirt\u cust\template\product.phtml中使用ajax模板

             $.ajax({
        url:'<?php echo $this->getUrl('layout/product/ajaxData') ?>',
        type:'post',
        data: {id:31},
        success:function(result) {
            $('#res_html').html(result);
        }
    });
$.ajax({
url:“”,
类型:'post',
数据:{id:31},
成功:功能(结果){
$('res#u html').html(结果);
}
});
我在本地localhost/shirt/layout/product/ajaxData中的ajaxurl工作正常 但在我的服务器上不工作。路径为:162.144.13.7/o/tailor定制/layout/product/ajaxData

获取404错误

我尝试了任何方法,但没有找到任何解决方案。请帮我解决这个问题

这段代码有什么问题请提出建议。我的服务器是linux。

etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>

<config>

<modules>
    <Attribute_Layout>
        <version>0.0.1</version>
    </Attribute_Layout>
</modules>

<global>
    <blocks>
        <attribute_layout>
            <class>Attribute_Layout_Block</class>
        </attribute_layout>
    </blocks>
</global>
<frontend>
    <routers>
        <layout>
            <use>standard</use>
            <args>
                <module>Attribute_Layout</module>
                <frontName>layout</frontName>
            </args>
        </layout>
    </routers>
    <layout>
        <updates>
            <attribute_layout module="Attribute_Layout">
                <file>attribute_layout.xml</file>
            </attribute_layout>
        </updates>
    </layout>
</frontend>
</config>
<?xml version="1.0"?>
<config>
<modules>
    <Attribute_Layout>
        <version>0.0.1</version>
    </Attribute_Layout>
</modules>
<frontend>
    <routers>
        <layout>
            <use>standard</use>
            <args>
                <module>Attribute_Layout</module>
                <frontName>layout</frontName>
            </args>
        </layout>
    </routers>
    <layout>
        <updates>
            <layout>
                <file>attribute_layout.xml</file>
            </layout>
        </updates>
    </layout>
</frontend>
<global>
    <blocks>
        <layout>
            <class>Attribute_Layout_Block</class>
        </layout>
    </blocks>
</global>
</config>

0.0.1
标准
属性布局
布局
属性_layout.xml
属性\布局\块
和design\frontend\default\shirt\u cust\layout\attribute\u layout.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">

<default>
<attribute_layout_product_ajaxData>
       <block type="layout/product" name="root" output="toHtml" template="attribute_layout/product.phtml" />
</attribute_layout_product_ajaxData>    

</default>

</layout>
<?xml version="1.0"?>
<layout version="0.0.1">
    <layout_product_ajaxData>
       <block type="layout/product" name="root" output="toHtml" template="attribute_layout/product.phtml" />
    </layout_product_ajaxData>
</layout>