![]() |
Get PHP contents from JQuery
I can use the following JQuery function to return PHP results after a form submission:
Code:
$(".some_class").bind("submit", function () { |
er, you’re already doing that.
|
Thanks for your reply. I'm trying to display the contents of a PHP file in a div (#results) without submitting a form. The above code uses a form submission.
|
Quote:
Code:
$('#php_results').load("somefile.php"); |
Quote:
and if it were indeed submitting the form, the AJAX call would be pointless because when the response comes back, the handling JS code is gone due to the (re)load. |
Yeah, I was trying to bind a link to the function. I tried this:
Code:
$(".refresh").click(function(){ |
When do you trying binding to the click function? Before or after the page loads?
|
I'm trying to do it after the page loads (otherwise I would just reload the page via js). I've also used:
Code:
$(".refresh").live("click", function () { |
perhaps this then. also if data.php needs some information posted to it to return a result, this is not good enough becuase you are nto capturing and sending any data to data.php
Code:
$(document).ready(function(){ |
Yea, I've tried that as well. My php file echoes lorem ipsum for testing - maybe I have another conflicting script running. Thanks for the replies ...
|
| All times are GMT +1. The time now is 06:13 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.