Answer the question
In order to leave comments, you need to log in
How to display block via php and not via ajax?
Good afternoon! There is an advanced search module, in which, after loading the page, a part is displayed using an ajax request:
loadS = function(cat)
{
if(fieldsHTML == 'none')
{
$("#search_fields").html('<center><img src="{%$settings.path%}images/ajax-loader.gif" height="19" /></center>');
}
$.ajax({
type: "GET",
url: "{%$settings.path%}search_ajax/",
cache: false,
data: "cat_id=" + cat,
success: function(html){
if(html != fieldsHTML)
{
$("#search_fields").html(html);
fielS(fields);
}
fieldsHTML = html;
}
});
};
Answer the question
In order to leave comments, you need to log in
1. climb into PHP, where the general page is displayed, add the output of the information you need there
2. or attach a general Ajax page loading indicator to the page so that the page is displayed when ALL content on the site is loaded. make it remove on the ajax event - success
ajax- and native php- have slightly different logic of work, one is front, the other is back.
so just "replacing" one with the other is not an option
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question