i need to use jquery for something.. but i need to get a php file containing the data so that jquery (js) will output the content of this file.
if you get that..
thanks
ash
get file
Re: get file
you cant ge the contents of a file on the server directly, you will have to do an ajax request for the file...
Re: get file
so how would i do this?
i found this..
i found this..
$.ajax({ url: "xxx/xxx.php", type: "GET", data: data, cache: false, success: function (html) { alert("HTLM = " + html); $('#product-list').html(html); } });would i put it in a function or just js tags?
I would put a signature.. BUT, i don't have the time.
Re: get file
Looks like jQuery to me... so I can't really help with that
If it is correct, it can work in both of those situationsashwood wrote:would i put it in a function or just js tags?
Re: get file
this is what ive got
index.php
index.php
<html> <head> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jq ... "></script> <script type='text/javascript' langauge='javascript'> $.ajax({ url: "source.php", type: "GET", data: data, cache: false, success: function (html) { alert("HTLM = " + html); $('#jquery-div').html(html); } }); </script> </head> <body> <div id='jquery-div'></div> </body> </html>source.php
<?php echo "Work work work work work "; ?>but nothing
I would put a signature.. BUT, i don't have the time.