Bad Credit Personal Loans - Credit Counseling - Loans - Credit Reports - Credit Card

PDA

View Full Version : Prototype.js how to set a parameter dynamic??


123GoToAndPlay
Oct 23rd 2007, 12:47 pm
I do get the right div but i can't get the randomID


new Ajax.Updater('div-'+randomIDValue, '/edit-file.php', { method: 'post' , parameters: {randomID: '+randomIDValue+'}});


any suggestions?

123GoToAndPlay
Oct 24th 2007, 3:52 am
new Ajax.Updater(
\'div-\'+randomID,
\'/edit-file.php\',
{ method: \'post\' , parameters: \'randomID=\'+randomIDValue
});

krakjoe
Oct 24th 2007, 4:23 am
urm ...


new Ajax.Updater( 'div-'+randomIDValue, '/edit-file.php', { method: 'post', parameters: { randomID: randomIDValue } } );

123GoToAndPlay
Oct 25th 2007, 1:02 am
@krokjoe, maybe i should have told you the code i posted is in php.

So
<?php

$header .= '
...here the ajax javascript code....
'
?>

That's why i needed to escape ' and had problems with setting the parameters.