1

我通过JQuery.post文件中的方法传递我的数据。当 Joomla 2.5 中的服务器上的“搜索引擎友好 URL”和“使用 URL 重写”关闭时,它可以成功运行,但是当这两个设置都打开时,则 urlJQuery.post正在更改并且无法正常工作。

jQuery.post('index.php?option=com_requests&controller=dashboard&task=messagesendtocook&format=raw&tmpl=component', { 
    replymessage:replymessage,fromid:fromido,msdid:msdido,refid:refido}, function(data) {
        alert(data);
        setTimeout( 'reload_parent_window();', 2000 );  
        window.parent.SqueezeBox.close();
}); 

SEO设置关闭时我的 URL 参数

index.php?option=com_requests&controller=dashboard&task=messagesendtocook

成功运行。

SEO设置为 ON时我的 URL 参数

index.php/component/requests/index.php?option=com_requests&controller=dashboard&task=messagesendtocook

哪个没有运行。

4

2 回答 2

3

Juri::root()与网址一起使用。所以代码将是 -

jQuery.post('<?php echo Juri::root()?>index.php?option=com_requests&controller=dashboard&task=messagesendtocook&format=raw&tmpl=component', { 
    replymessage:replymessage,fromid:fromido,msdid:msdido,refid:refido}, function(data) {
        alert(data);
        setTimeout( 'reload_parent_window();', 2000 );  
        window.parent.SqueezeBox.close();
}); 
于 2013-11-13T15:30:36.587 回答
0

我发现只是/在 URL 中添加一个前导也是一样的,把它变成:

'/index.php?option=com_requests&controller=dashboard&task=messagesendtocook&format=raw&tmpl=component'
于 2014-10-23T16:40:52.217 回答