ok i admit, i got some problems here understanding...i realize my
event, that needs to be set, is onClick()

its just hard for me to differentiate, what is actual JS syntax and
what is just stuff you made up..like this
"ev.preventDefault(); "

<script id="demo" type="text/javascript">

function requestDelete(name)
{
        alert(name);
        $('#attachments_div').load('deleteattachment', {data: name})
}
</script>
<div id="attachments_div">
                <?php

                                foreach ($attachments as $attachment):

                                echo $too_many;
                                echo '<br>';

                                echo $attachment['LinksTmp']['name']; ?>

                                <a onclick="requestDelete('test.jpg')"><img 
src="../img/icons/
close.png" /></a>

                     <?php   endforeach;    ?>

</div>

this is the code that is rendered in the view, that is loaded in a
DIV. as you said, the onClick() event works only after the
initialization....so how would i adapt that to your proposal?
i also dont use ajax anymore. so technically we could loose that part
of your code too, right?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to