How to load a custom html module using ajax-call joomla 2.5

前端 未结 1 568
南方客
南方客 2021-01-16 09:20

I have in my html page a link with class name =\"flyer\" and href=\"MY_HREF\".
When the user click\'s in the link I want to load a \"custom html\" module with specifi

相关标签:
1条回答
  • 2021-01-16 09:52

    Ok i found the solution.

    1)We create our html module and we set a custom position e.x myposition

    2)We create an article and we load our module {loadposition myposition}.

    Note that every article has its own ID and ALIAS.

    3)The final url for our ajax call is: http://myurl.gr/ID-ALIAS.html?tmpl=component&type=raw

    Note that if you add any content to the article you will get the html of the article + the html of the module.

    The ajax call code is:

    MY_HREF = ID-ALIAS.html

    jQuery.ajaxSetup ({
    
            dataType: "html",
            cache: false  
        });    
        var portfolioItemURL = "";  
        jQuery(".flyer").click(
            function(){
                portfolioItemURL = jQuery(this).find("a").attr("MY_HREF") + '?tmpl=component&type=raw';
                jQuery("#ajaxCallContainer").load(portfolioItemURL);
            }
    ); 
    

    kisses from Kalymnos,Greece

    0 讨论(0)
提交回复
热议问题