Thanks for all your help. Thing thing has been buggin me for a very long!
Could you explain what exactly was happening with my original code that
made the confirm fire twice?
On Wednesday, 11 July 2012 14:13:13 UTC-4, Jason wrote:
>
>
>
> I don't see any problems with the HTML elements
>
> and to answer your question the observe method identifies the function as
> the "handler" and passes the event object to the handler
>
>
> and you can get the javascript to one line if you want
>
> $$("td a.delete").invoke("observe","click",confirmDelete);
>
>
> Jason Westbrook | T: 313-799-3770 | [email protected]
>
>
>
> On Wed, Jul 11, 2012 at 10:40 AM, thinsoldier <[email protected]
> > wrote:
>
>>
>>
>> On Wednesday, 11 July 2012 12:37:45 UTC-4, Jason wrote:
>>>
>>>
>>> can you either post the HTML that you are using or post the url where it
>>> is located publicly?
>>>
>>>
>> Here is the html:
>>
>> <table>
>> <thead>
>> <tr>
>> <th>Saved</th>
>> <th>Name</th>
>> <th>Rename</th>
>> <th>Delete</th>
>> <th>Switch Format</th>
>> <th>Browse</th>
>> </tr>
>> </thead>
>> <tbody>
>> <tr>
>> <td>
>> 11 Nov, 2009
>> </td>
>> <td>
>> <a class="rsslink" href="savedsearches.php?cmd=rss&ssid=39"
>> title="Access RSS Feed"> <img src="/images/icons/rss_16.png"> Sale less
>> than x 250 thousand </a>
>> </td>
>> <td>
>> <a class="rename"
>> href="user.php?cmd=savedSearchRenameForm&id=39">Rename</a>
>> </td>
>> <td>
>> <a class="delete" href="user.php?cmd=savedSearchDelete&id=39"
>> title="Cannot undo."><img src="/images/icons/close_32.png" alt="delete"></a>
>> </td>
>> <td>
>> <a class="reformat"
>> href="user.php?cmd=savedSearchSwitchFormat&id=39" title="Receive this
>> by e-mail instead.">
>> <img src="/images/icons/rss_32.png"> <img
>> src="/images/icons/arrow_right_16.png"> <img
>> src="/images/icons/email_32.png">
>> </a>
>> </td>
>> <td>
>> <a class="browse"
>> href="search.php?cmd=search&formcat=residential&searchType=BUYSEARCH&searchOnPriceField=price&island=252&maxprice=250000"><img
>>
>> src="/images/icons/search_32.png" alt="view results"></a>
>> </td>
>> </tr>
>> <tr>
>> <td>
>> 25 Jun, 2012
>> </td>
>> <td>
>> <a class="rsslink" href="savedsearches.php?cmd=rss&ssid=77"
>> title="Access RSS Feed"> <img src="/images/icons/rss_16.png"> All the
>> -plexes in NP </a>
>> </td>
>> <td>
>> <a class="rename"
>> href="user.php?cmd=savedSearchRenameForm&id=77">Rename</a>
>> </td>
>> <td>
>> <a class="delete" href="user.php?cmd=savedSearchDelete&id=77"
>> title="Cannot undo."><img src="/images/icons/close_32.png" alt="delete"></a>
>> </td>
>> <td>
>> <a class="reformat"
>> href="user.php?cmd=savedSearchSwitchFormat&id=77" title="Receive this
>> by e-mail instead.">
>> <img src="/images/icons/rss_32.png"> <img
>> src="/images/icons/arrow_right_16.png"> <img
>> src="/images/icons/email_32.png">
>> </a>
>> </td>
>> <td>
>> <a class="browse"
>> href="search.php?cmd=search&formcat=residential&searchType=BUYSEARCH&searchOnPriceField=price&island=410&property_type%5B0%5D=655&property_type%5B1%5D=656&property_type%5B2%5D=657&property_type%5B3%5D=695"><img
>>
>> src="/images/icons/search_32.png" alt="view results"></a>
>> </td>
>> </tr>
>> </tbody>
>> </table>
>>
>>
>>
>>>
>>> you can simplify your javascript this way
>>>
>>>
>>> $$('td a.delete').each(function(s){
>>> s.observe('click', **confirmDelete);
>>> } );
>>>
>>
>> But wouldn't the confirmDelete function need to be given the click event
>> so it knows which click Event object to event.*stop*() ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Prototype & script.aculo.us" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/prototype-scriptaculous/-/u_tbuSa5zEcJ.
>>
>> 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/prototype-scriptaculous?hl=en.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/wwHOXznXcpYJ.
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/prototype-scriptaculous?hl=en.