ad2003
ad2003

Reputation: 323

how to load content from external php jquery

I'm stupid, sorry. But I really don't get it working! I would love to have the content beeing loaded from an external php file.

e.g. myfeed.php .

the content is wrapped in a class called "myfeed".

$(document).ready(function(){
$.ajaxSetup({cache:false});
$("#bestseller a").click(function(){

    var post_id = $(this).attr("rel")
    $(".featureline").html("loading...");
    $(".featureline").load(jQuery(this).attr("href") + " .myfeed")
    return false;
});

});

could anybody please tell me how to modify this code above to get it working? The Ajax loading works - but I don't get the external file loaded.

Many thanks! AD

Upvotes: 0

Views: 520

Answers (2)

mdziekon
mdziekon

Reputation: 3627

$(".featureline").load(FileURL);

FileURL should be path to your file, eg. myfeed.php.

Upvotes: 0

Rodik
Rodik

Reputation: 4092

The + " .myfeed") looks out of place in this line:

  $(".featureline").load(jQuery(this).attr("href") + " .myfeed")

Remove it and your query will work.

$(".featureline").load(jQuery(this).attr("href"));

Upvotes: 1

Related Questions