Click here to Skip to main content
15,895,988 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How to call php function in javascript?
How to call php function in jquery?
Posted
Comments
Sergey Alexandrovich Kryukov 24-May-12 15:13pm    
Perhaps by "call" you mean something unusual... :-)
--SA

There is no such thing as "in jQuery", because jQuery is also JavaScript. From the JavaScript standpoint (I assume you use client-side JavaScript, server-side JavaScript is not used much), there is no such thing as "PHP", which works on the server side. JavaScript comes into play when a page generated by PHP is already sent to the client and loaded; the result of it is just HTML.

—SA
 
Share this answer
 
Comments
VJ Reddy 25-May-12 6:42am    
Good answer 5!
Sergey Alexandrovich Kryukov 25-May-12 11:42am    
Thank you, VJ.
--SA
ali sheibani 25-May-12 12:08pm    
I have access to the bank without having to refresh the page with jquery
for rating a subject
Sergey Alexandrovich Kryukov 28-May-12 18:04pm    
OK, so what?
--SA
call php function in javascript/jquery
You need to use AJAX. Use traditional XMLHttpRequest OR jQuery defined .ajax method for it.

http://api.jquery.com/jQuery.ajax/[^]
http://api.jquery.com/category/ajax/[^]
http://www.w3schools.com/jquery/jquery_ref_ajax.asp[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-12 0:54am    
I would never call it a "call". This is not even the RPC unless you try hard to mimic it to some extent. You just send an HTTP request and get HTTP response. Calling it a "call" creates delusions which are hard to debunk.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900