dqz30992 2015-01-19 12:49
浏览 64

Joomla 3.3,AJAX,组件参数不会加载

I've build a simple component, and have some parameters set on the component view. I am trying to load the menu item holding the component with AJAX. I startet out with code from Chris Duells Ajax in Joomla with jQuery, which says "you can call absolutely any component you like, as long as you know the non SEF link to the page you are after". If anyone could explain to me why I can't use SEF urls that'd be great.

To go around the SEF problem, I modified the mod_module helper to supply a data-link attribute with the corresponding internal url, which I then pick up with jQuery and feed to my ajax function.

function loadContent( url ){
        console.log( 'url is: ' + url );
        $( "#load" ).load( url + "&tmpl=barebone");
    }

An example URL would be index.php?option=com_mycomp&view=feat&Itemid=117.

If I go straight to my component through the SEF url, the parameters are displayed, even if I use the internal url, but if I try loading it with the function above, parameters are ignored. It does load parameters if I start out by loading that particular component, but that is not a solution. In other words, it seems like Joomla! is supplying me only with view.php and none of the internals behind it.

How can I make this work?

Please let me know if I neglected to mention important information or if I need to make myself more clear.

  • 写回答

1条回答 默认 最新

  • doupo2633 2015-01-20 02:32
    关注

    Adding the domain in the function seemed to fix the problem.

        function loadContent( url ){
            $( "#load" ).load( "http://myurl.com/" + url + "&tmpl=barebone");
        }
    
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?