Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[JS] jquery get problem

Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
hello,
i've got a little problem
Code:
var divs;
var id;
var counter1;
function loadTags(){
    divs = document.body.getElementsByTagName('div');
    counter1 = 0;
    for(counter1 = 0;counter1 <= divs.length; counter1++){
        id = divs[counter1].id;
        $.get("./common.php", {getTags: id}, function (data){
            divs[counter1].innerHTML += data;

        });
    }
}
The succes function of the $.get (jquery)request wont take over the variable counter1. I don't know why, i've tried alot but can't seem to find the problem...
 
Joined
Sep 10, 2006
Messages
2,817
Reaction score
1,417
I had a feeling they do, considering you pass the id directly to get and unless your primary keys(are you getting that text from db, right) are varchars, which I think is not even possible, it would make sense they are numbers.

Either way, did my code work? o_O
 
Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
Well with my code if i changed the variable counter1 in the succes function it worked, yours just did nothing ....
 
Back
Top