Page 1 of 1
Incorporating PHP in a javascript pop-up messages
Posted: Sun Jan 17, 2010 3:02 am
by ZeroComp
Well I got all the pop up boxes working and am just wondering, say I have an attack button and a pop up comes up saying how much you hit. How do i make it use the php script without doing WHOLE javascript makeover?
Re: Incorporating PHP in a javascript pop-up messages
Posted: Sun Jan 17, 2010 3:08 am
by Torniquet
umm woudnt you do something like
alert(<?php echo $damageDelt; ?>)
or something similar to that.
Re: Incorporating PHP in a javascript pop-up messages
Posted: Sun Jan 17, 2010 3:13 am
by ZeroComp
oh durrr thanks, im a bit new to js so excuse my poor knowledge of javascript

Re: Incorporating PHP in a javascript pop-up messages
Posted: Sun Jan 17, 2010 5:19 am
by hallsofvallhalla
yes or you can set it when you define the variable
var damagedealt = <?php echo $damageDelt; ?>;
alert(damagedealt);
Re: Incorporating PHP in a javascript pop-up messages
Posted: Sun Jan 17, 2010 1:25 pm
by Torniquet
ZeroComp wrote:oh durrr thanks, im a bit new to js so excuse my poor knowledge of javascript

dnt worry lol. im in the same boat.
look into using jquery. makes life no much easier lol
Re: Incorporating PHP in a javascript pop-up messages
Posted: Sun Jan 17, 2010 3:57 pm
by Chris
Torniquet wrote:ZeroComp wrote:oh durrr thanks, im a bit new to js so excuse my poor knowledge of javascript

dnt worry lol. im in the same boat.
look into using jquery. makes life no much easier lol
jQuery is a load of balls. It's an extra 4000 lines of code when you don't even use half of it.
Re: Incorporating PHP in a javascript pop-up messages
Posted: Sun Jan 17, 2010 6:44 pm
by Torniquet
Chris wrote:Torniquet wrote:ZeroComp wrote:oh durrr thanks, im a bit new to js so excuse my poor knowledge of javascript

dnt worry lol. im in the same boat.
look into using jquery. makes life no much easier lol
jQuery is a load of balls. It's an extra 4000 lines of code when you don't even use half of it.
for you maybe. but i find it easier, whether i use the entire thing or not.