V
V
vanproskur2021-03-28 11:37:39
AJAX
vanproskur, 2021-03-28 11:37:39

Why does ajax move the div to the right?

css:

.pagemain {
            margin: 500px;
            width: 50%;
            margin-top: 70px;
        }


ajax:
function mode() {
            $.ajax({
                url: "/app",
                success: function(data) {
                    $('#page-wrapper').html(data);
                }
            });
        };
        setInterval(mode, 1000);


html:
<div id = "page-wrapper" class="page-wrapper">
     <img src="img.jpg"/>
</div>

with ajax:
60603f52ebea2004355802.png

without ajax:
6060404f843d9462653932.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-03-28
@firedragon

Run through the resulting house and understand what the mistake is.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question