views:

39

answers:

1

Hello,this code work fine on localhost,when loading div from one blog to another(both on localhost),but when try to load from blog that is on internet to another blog(localhost),it doesn't work,what could be the problem?Here is the code.

<?php

$urlPage = 'http://www.somepage.com/'; //dont work

//$urlPage = 'http://localhost/myBlog1/'; //work fine
?>

<script type="text/javascript">

    var addr;

    jQuery(document).ready(function($){

        addr = '<?php echo $urlPage; ?>';

        $.ajax( {
            url: addr,
            success: function(html) {
                $(".divToLoadContent").append($(html).find('#sidebar ul').html());
            }
        });
        return false;
    });
</script>

<style type="text/css">
    .divToLoadContent {
        margin:0px;
        border: 1px solid lime;
        width: 100%;
    }
</style>

<div class="divToLoadContent">
</div>