View Full Version : Is it possible to call a PHP functions you create, in a Javascript?
Repins
03-31-2008, 08:01 PM
Basically I have this javascript that makes my images load pretty, but I would like to add my little 'rating' php function on the window the java script loads.
I know one is server side and the other isn't but is it possible?
Vershun
03-31-2008, 08:03 PM
Basically I have this javascript that makes my images load pretty, but I would like to add my little 'rating' php function on the window the java script loads.
I know one is server side and the other isn't but is it possible?
Yes it's possible. Welcome to the horrible world of AJAX.
sn1per
04-01-2008, 05:22 AM
Thanks Vershun!
pulaskeet
04-01-2008, 02:01 PM
with ajax you can call a function, say "rating.php" and stream back xml/json data, parse it with js and load it on your page. it's not always fun to code but when it's done it's slick.
gmail is a good example
sn1per
04-01-2008, 02:15 PM
See, I want to use LightBox (what wordpress uses to display images) to display images when a user clicks a thumbnail on a page, and have a 5 star rating function show up on the window lightbox uses to display the image.
Lightbox=js
voting=php
I wonder if it's worth the effort.
doolbman
04-01-2008, 02:42 PM
I use the 5 star rating system on hi5experts.com you can check out js on it , it might help you
turbo32
04-01-2008, 09:58 PM
See, I want to use LightBox (what wordpress uses to display images) to display images when a user clicks a thumbnail on a page, and have a 5 star rating function show up on the window lightbox uses to display the image.
Lightbox=js
voting=php
I wonder if it's worth the effort.
AJAXing something this simple isn't worth it.
You could have the clicks on the rating system redirect to a script.php?star=4 and then have the php script pass you back to the voting page..
sn1per
04-02-2008, 05:24 AM
AJAXing something this simple isn't worth it.
Agreed. I will just put the voting below the thumbnails.
Thanks everyone for the replies!
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.