Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
calling php function from javascript?

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> PHP
View previous topic :: View next topic  
Author Message
iridion_us
New one
New one


Joined: 22 Oct 2007
Posts: 1

PostPosted: Mon Oct 22, 2007 1:41 pm    Post subject: calling php function from javascript? Reply with quote

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(); ?>">

they say it is not possible on javascript but it is possible on ajax.
actually i have to call a javascript function plus a php function
inside a onmouseover() how i would go about with this?

please take note i'm newbie on ajax.

Thanks in advance.
Back to top
View user's profile Send private message
Jesdisciple
Frequent Poster
Frequent Poster


Joined: 20 Oct 2007
Posts: 36
Location: Tejas

PostPosted: Mon Oct 22, 2007 5:32 pm    Post subject: Reply with quote

It's not calling a PHP function in the way that we usually think of calling a function. Basically, it's linking to a PHP file in a way that's similar to forms, but using JavaScript so you don't have to leave the current page or even stall the rest of the script. (Although it doesn't have to be a PHP file; it can be ASP or just plain text, but whatever is left in the file after the server gets done with it is received by the JavaScript.)

I tried to formulate an example, but the JavaScript had a bug somewhere. A (primitive) working example which emulates Google Suggest can be found at http://w3schools.com/ajax/default.asp (after a few pages, because I think you need the introduction).
_________________
In ALL things, strive for ><>,
Chris
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
eaiteam
New one
New one


Joined: 14 Nov 2007
Posts: 1

PostPosted: Wed Nov 14, 2007 3:48 pm    Post subject: Example of PHP function called from java script. Reply with quote

Please go to this link to see an example:

http://www.tizag.com/ajaxTutorial/ajax-javascript.php

Thanks,
Back to top
View user's profile Send private message
koolman
New one
New one


Joined: 21 Jun 2008
Posts: 1

PostPosted: Sat Jun 21, 2008 1:08 pm    Post subject: Reply with quote

You may check an Ajax component for PHP called KoolAjax.

See the example of how to call function of PHP from javascript:
http://www.koolphp.net/support/demos/#koolajax.example_function_callback_basic

Documentation: http://www.koolphp.net/support/docs/#ka_cs_koolajax

Download components: http://www.koolphp.net/?mod=download
_________________
www.koolphp.net - UI Components for PHP [ Code few, Deliver HUGE ]
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> PHP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert