Question

I use

$('#new-nav1').load("/yiite/index.php/includes/load_second #table",{

      ID:ID,name:name,ord:ord
});

I want to put it under loaded data, there will be a lot of data, that`s why load it into another div is not the solution Every time it replaces elements in idv #new-nav1.

Was it helpful?

Solution

You can append after the data is loaded using a temporary div.

$("<div/>").load("/yiite/index.php/includes/load_second #table", {
    ID: ID, name: name, ord: ord
}, function () {
    $(this).appendTo("#loaded-data").unwrap();//unwrap removes the temp div
});

OTHER TIPS

You can give a try to ajax call as shown below..

$(document).ready(function() {
        $.ajax({
        url: "/yiite/index.php/includes/load_second #table",
        type: 'GET',
        data: {ID:ID,name:name,ord:ord},
        success: function(responseText){
            $('#new-nav1').append(responseText);
        },
        error: function(responseText){
        }
    });
    });

For more information :-

http://api.jquery.com/append/

http://api.jquery.com/jQuery.ajax/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top