Hack Forums
[Help] [Ajax] $(...).load is not a function - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [Help] [Ajax] $(...).load is not a function (/showthread.php?tid=5864190)



[Ajax] $(...).load is not a function - .eXe - Jul 20, 2018

Hey guys

So I've got some ajax load functions that load different pages in to divs, however, when I click to load the second page, it only works for the first click. Then I get the error in the subject. Any ideas how to diagnose?

My JS functions as below:

Code
function loadClients() {
    $("#mainbody").load("views/clients.php");
}


function loadArenas() {
    $("#mainbody").load("views/arena.php");
}

function loadHorses() {
    $("#mainbody").load("views/horses.php");
}


Fixed it. I was calling jQuery a second time on the second page and didn't realise.