Honestly I'm not exactly sure

there is a possibility that the observe method was calling confirmDelete
instead of just tagging it as the event handler

Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com



On Wed, Jul 11, 2012 at 12:06 PM, thinsoldier
<thinsold...@thinsoldier.com>wrote:

> 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 | jwestbr...@gmail.com
>>
>>
>>
>> On Wed, Jul 11, 2012 at 10:40 AM, thinsoldier <
>> thinsold...@thinsoldier.com> 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&amp;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&amp;id=
>>> **39">Rename</a>
>>>   </td>
>>>   <td>
>>>     <a class="delete" href="user.php?cmd=**savedSearchDelete&amp;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&amp;**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&**
>>> amp;formcat=residential&amp;**searchType=BUYSEARCH&amp;**
>>> searchOnPriceField=price&amp;**island=252&amp;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&amp;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&amp;id=
>>> **77">Rename</a>
>>>   </td>
>>>   <td>
>>>     <a class="delete" href="user.php?cmd=**savedSearchDelete&amp;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&amp;**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&**
>>> amp;formcat=residential&amp;**searchType=BUYSEARCH&amp;**
>>> searchOnPriceField=price&amp;**island=410&amp;property_type%**
>>> 5B0%5D=655&amp;property_type%**5B1%5D=656&amp;property_type%**
>>> 5B2%5D=657&amp;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', **confirmDele**te);
>>>>   } );
>>>>
>>>
>>> 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<https://groups.google.com/d/msg/prototype-scriptaculous/-/u_tbuSa5zEcJ>
>>> .
>>>
>>> To post to this group, send email to prototype-scriptaculous@**
>>> googlegroups.com <prototype-scriptaculous@googlegroups.com>.
>>> To unsubscribe from this group, send email to prototype-scriptaculous+**
>>> unsubscr...@googlegroups.com<prototype-scriptaculous%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/prototype-scriptaculous?**hl=en<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
> prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> 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 post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to