Well, if you HAD to stay HTML, you could split() the html.
success: function(result){
var data1 = result.responseText.split([SPLIT CHARACTER]);
etc ... you could use regular expressions, but json is so much more
efficient.
... You supposed that the elements have a text field !
I wrote this:
On 10 fév, 12:11, phicarre wrote:
> Thank you for your solutions.
> Are we obliged to use jason ? Is it possible to stay "html" ?
>
> On 9 fév, 19:42, Ryan wrote:
>
> > What? Sorry, but this is hard to understand. I believe
Thank you for your solutions.
Are we obliged to use jason ? Is it possible to stay "html" ?
On 9 fév, 19:42, Ryan wrote:
> What? Sorry, but this is hard to understand. I believe you're trying
> to set element data from a value in a php file, right? If so, that's
> pretty easy using JSON.
>
> In
What? Sorry, but this is hard to understand. I believe you're trying
to set element data from a value in a php file, right? If so, that's
pretty easy using JSON.
In PHP, json_encode() converts an array or object into a string, and
in Javascript it takes that string and converts it to an object. U
my_module.php
'hello',
'var2' => 'world'
);
echo json_encode($myArray);
?>
helloWorld.html
$.ajax(
{
type: "POST",
url:'my_module.php',
dataType: 'json', //
5 matches
Mail list logo