Page 1 of 1

I want to use php function in the java script

Posted: Thu Oct 09, 2008 6:34 am
by Rangana
Iwant to use php function in the javascript pls help me.

Re: I want to use php function in the java script

Posted: Thu Oct 09, 2008 7:07 am
by onion2k
You can't.

Re: I want to use php function in the java script

Posted: Thu Oct 09, 2008 9:16 am
by iris
i hv been made to realise the truth that trying to do somthing even u dont get it will widen ur knowledge.
try writin out some things then u can b corrected, u can always do better than u think. Bro
:D

Re: I want to use php function in the java script

Posted: Thu Oct 09, 2008 9:21 am
by onion2k
iris wrote:i hv been made to realise the truth that trying to do somthing even u dont get it will widen ur knowledge.
try writin out some things then u can b corrected, u can always do better than u think. Bro
:D
"AOL speak" is against the rules here. Don't use it again please.

Re: I want to use php function in the java script

Posted: Thu Oct 09, 2008 9:25 am
by mattcooper
iris wrote:i hv been made to realise the truth that trying to do somthing even u dont get it will widen ur knowledge.
try writin out some things then u can b corrected, u can always do better than u think. Bro
:D
Yeah, whatever, maybe stick to talking about PHP rather than getting all spiritual?

I think what you want to do is use values that are passed to PHP variables in your Javascript, in which case you can. Simply give your Javascript file a .js.php extension and then use whatever PHP code you want. so, for example:

Code: Select all

 
<script>
//script.js.php
document.getElementById('el').innerHTML = "<?php echo $yourValue ?>";
</script>
 
Have fun :)

Re: I want to use php function in the java script

Posted: Thu Oct 09, 2008 9:27 am
by onion2k
mattcooper wrote:Yeah, whatever, maybe stick to talking about PHP rather than getting all spiritual?
:D

Re: I want to use php function in the java script

Posted: Thu Oct 09, 2008 9:36 am
by mattcooper
Yar, I find time-wasters ever so tiresome <yawns>

Re: I want to use php function in the java script

Posted: Fri Nov 07, 2008 2:40 am
by iris
Pls wat does "AOL" means? Pls!!!!!