views:

60

answers:

2
$(document).ready(function(){
$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");

$("a[target!='_blank'][target!='_top']").click(function(){
$("#actualcontent").load($(this).attr("href"));

window.location.hash=$(this).attr("href");
        return false;
    });
});

So I have this code so that my links load in the div actualcontent. But I'd rather use dynamicdrive's ajax load function to load the content, as it doesn't seem to freeze the page like jQuery's does. Would that be possible?

say my dynamicdrive ajaxload function is called ajaxpage() ?

Could I just do

var url=$(this).attr("href");
ajaxpage(url);

?

+2  A: 

Yes, that will work just fine as long as the ajaxpage function accepts a string parameter.

Andrew Hare
+2  A: 

Remember jQuery is JavaScript and can be used in with regular JavaScript.

Since $(this).attr("href"); is returning a sting you can use it in any Javascript function that accepts a string variable.

RedWolves