Reputation: 173
I wanna know why this doesn't work anymore... it worked before, and I cant see whats wrong...
I want to load a page in class container2 through this script when clicking an a href link with the class changePage.
$(document).ready(function () {
$(".changePage").click(function () {
$(".container2").fadeOut("slow", function () {
$(this).load(href, function (responseText, status, req) {
if (status != "error") $(this).slideDown("slow");
});
});
return false;
});
});
Upvotes: 0
Views: 272
Reputation: 74420
I think you want:
$(document).ready(function () {
$(".changePage").click(function () {
var href = this.href; //<< define href here
$(".container2").fadeOut("slow", function () {
$(this).load(href, function (responseText, status, req) {
if (status != "error") $(this).slideDown("slow");
});
});
return false;
});
});
Upvotes: 1