Forum Moderators: open

Message Too Old, No Replies

calling php function from javascript or ajax?

         

iridion_us

8:28 pm on Oct 22, 2007 (gmt 0)

10+ Year Member



How do you call a php function from javascript.

Let say i have a php function like this below;

function myfunc() {
etc...
}

now i have javascript below using onmouover();
<a href="" onmouseover="">
<img src="mypicture.jpg" width="" height="" border="2"/>
</a>

what is the proper way to insert php myfunc() inside javascript
onmouseover() function. So that i can call the php function.

is this correct below?
<a href="" onmouseover="<?php myfunc();?>">

I have not tested that so i'm not sure if it is correct.

They say it is not possible in javascript, but possible on ajax.
Sorry but i don't know what is right to use for this javascript or ajax? any help please?

Thanks in advance.

jonathanbee

7:21 am on Oct 23, 2007 (gmt 0)

10+ Year Member



[en.wikipedia.org...]

the URL in the method is your php script.