Incorporating PHP in a javascript pop-up messages
Incorporating PHP in a javascript pop-up messages
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?
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
Re: Incorporating PHP in a javascript pop-up messages
umm woudnt you do something like
alert(<?php echo $damageDelt; ?>)
or something similar to that.
alert(<?php echo $damageDelt; ?>)
or something similar to that.
New Site Coming Soon! Stay tuned 
Re: Incorporating PHP in a javascript pop-up messages
oh durrr thanks, im a bit new to js so excuse my poor knowledge of javascript 
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Incorporating PHP in a javascript pop-up messages
yes or you can set it when you define the variable
var damagedealt = <?php echo $damageDelt; ?>;
alert(damagedealt);
var damagedealt = <?php echo $damageDelt; ?>;
alert(damagedealt);
Re: Incorporating PHP in a javascript pop-up messages
dnt worry lol. im in the same boat.ZeroComp wrote:oh durrr thanks, im a bit new to js so excuse my poor knowledge of javascript
look into using jquery. makes life no much easier lol
New Site Coming Soon! Stay tuned 
Re: Incorporating PHP in a javascript pop-up messages
jQuery is a load of balls. It's an extra 4000 lines of code when you don't even use half of it.Torniquet wrote:dnt worry lol. im in the same boat.ZeroComp wrote:oh durrr thanks, im a bit new to js so excuse my poor knowledge of javascript
look into using jquery. makes life no much easier lol
Fighting for peace is declaring war on war. If you want peace be peaceful.
Re: Incorporating PHP in a javascript pop-up messages
for you maybe. but i find it easier, whether i use the entire thing or not.Chris wrote:jQuery is a load of balls. It's an extra 4000 lines of code when you don't even use half of it.Torniquet wrote:dnt worry lol. im in the same boat.ZeroComp wrote:oh durrr thanks, im a bit new to js so excuse my poor knowledge of javascript
look into using jquery. makes life no much easier lol
New Site Coming Soon! Stay tuned 