Associate
ok, so i have a pretty decent understanding of php but am in need of some jquery based elements in my script (an image cropper).
so, in php I would do something like this:
The equivalent javascript - in my head - would be this:
but this doesn't work...
I'm struggling to find good javascript resources and dont really have time to wait for an amazon book. Tizag / w3schools are my php helpers of choice, but the Javascript stuff isn't brilliant.
Any pointers would be most appreciated.
so, in php I would do something like this:
PHP:
for($x=0;$x<10;$x++)
{
echo '<input type="hidden" name="ft_'.$x.'" id="ft_'.$x.'" value="1">';
echo '<input type="hidden" name="fl_'.$x.'" id="fl_'.$x.'" value="1">';
}
The equivalent javascript - in my head - would be this:
Code:
for($x=0;$x<10;$x++)
{
Dom.setAttribute('ft_'+ x.toString(), 'value', region.top);
Dom.setAttribute('fl_'+ x.toString(), 'value', region.left);
}
but this doesn't work...
I'm struggling to find good javascript resources and dont really have time to wait for an amazon book. Tizag / w3schools are my php helpers of choice, but the Javascript stuff isn't brilliant.
Any pointers would be most appreciated.