Answer the question
In order to leave comments, you need to log in
How to Ajax load html content?
There is html code:
<div class="city_wrapper">
<ul class="region_ul">
</ul>
</div>
$(".region_no, #select_city").click(function() {
$.ajax({ type: "POST",url: "/ajax/",data: { "city": 'subdomains'},cache: false, success: function(data){ $(".region_ul").html(data); } });
});
Answer the question
In order to leave comments, you need to log in
If you just need to load a list of cities, put in /ajax/city.php
echo '<li>Москва</li><li>Воронеж</li><li>Екатеринбург</li>';
Example:
The contents of the #id block will be loaded with data by reference.
$('#id').load('https://yousite.ru/test.html');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question