function loadcode(id) { $("#solve_" + id).load(location.protocol + "//" + location.host + "/code/" + id + "/",function() { alert("something happened here") }); }