[英]Magento Ajax from Module
我是magento模塊開發的新手。 我想從magento后端請求ajax調用。在這里,我做了模塊...這是屏幕截圖
我有這樣的領域:
<tpropay translate="label" module="tpropay">
<label>Tpro3</label>
<sort_order>670</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<comment><![CDATA[
<button class="scalable" onclick="return check(); ">Sync Products Now</button> ]]></comment>
<fields>
<active translate="label">
<label>Enabled</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</active>
</fields>
</tpropay>
現在,我想在用戶單擊按鈕時調用ajax嗎? 對如何包含javascript和發送ajax調用感到困惑...任何幫助將不勝感激
創建您要調用ajax的控制器,然后將JavaScript放在文件中,然后按如下所示的布局xml添加該js文件
<adminhtml_system_config_edit> <reference name="head"> <action method="addJs"><script>folder/ajax.js</script></action> </reference> </adminhtml_system_config_edit>
希望能有所幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.