[Phpmyadmin-devel] Unexpected javascript execution behaviour

Supun Nakandala supun.nakandala at gmail.com
Sat Jul 6 09:11:04 CEST 2013


On Sat, Jul 6, 2013 at 12:02 PM, Atul Pratap Singh <
atulpratapsingh05 at gmail.com> wrote:

> On Sat, Jul 6, 2013 at 7:38 AM, Supun Nakandala <supun.nakandala at gmail.com
> > wrote:
>
>> Hi Devs,
>> I am experiencing an unexpected behavior with respect to the following
>> two cases.
>>  1. Deleting a row from browse page.
>>  2. Deleting a row after searching
>>
>> In sql.js, AJAX.registerOnload binds 'click' event to  'a.delete_row.ajax'.
> In case of Browse page, the 'a.delete_row.ajax' elements are available at
> the time of event binding but on Search page, elements are not even
> created, they are created after one performs the search, so onload binding
> is unsuccessful. I guess using 'live' or 'on' instead of 'bind' would be
> better.
>
> I replaced the bind event with live and now everything works fine.
Thank you


>  In the first case  the request goes through the sql.js ajax handler. But
>> in the second case the request doesn't go through it and the request is not
>> an ajax request.
>>
>
> The request should still be an ajax request, just the onclick event is not
> bound.
>
>
>>  But in both cases the tag is same ("<a class='delete_row ajax") and in
>> both cases sql.js file is added to the responses which are displaying the
>> results. I tried to find what is going wrong here for sometime now and I
>> couldn't find it. I would appreciate if you can provide me some help to
>> figure this problem.
>>
>> Thank You
>>
>
>
> --
> Atul Pratap Singh
> http://blog.atulsisodia.in/
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Phpmyadmin-devel mailing list
> Phpmyadmin-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
>
>


-- 
Thank you
Supun Nakandala
Dept. Computer Science and Engineering
University of Moratuwa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20130706/d731f21a/attachment.html>


More information about the Developers mailing list