PDA

View Full Version : [JS] Problem



Luckyrare
29-05-2007, 09:02 PM
I am a noob when it comes to JS but I had a play around with AJAX with much help from carls tutorial and w3schools. This is most likely the very basics of JS but I dont know it ;)

username and post are both JS vars from a function, how would I go to the var rather than "username"

xmlhttp.open('POST', 'rep.php?u=username&p=post', false);


Like if it worked like PHP I could put something like this but its obv. not the same as php.

xmlhttp.open('POST', 'rep.php?u='.$username.'&p='.$post, false);


Thanks

Invent
29-05-2007, 09:04 PM
Try:

xmlhttp.open('POST', 'rep.php?u='+username+'&p=post', false);

Luckyrare
29-05-2007, 09:09 PM
Thank you Simon x] I am going to work on my JS :p

Want to hide these adverts? Register an account for free!