#8094: Html button inside html link gives pipe error!!!
------------------------------------+---------------------------------------
          Reporter:  italomaia      |         Owner:  nobody              
            Status:  closed         |     Milestone:  1.0 beta            
         Component:  Uncategorized  |       Version:  SVN                 
        Resolution:  invalid        |      Keywords:  error, html, strange
             Stage:  Unreviewed     |     Has_patch:  0                   
        Needs_docs:  0              |   Needs_tests:  0                   
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Changes (by raphael):

  * status:  reopened => closed
  * resolution:  => invalid

Comment:

 Basically, it is an HTML error.

 when you write something like :
 {{{
 <a href="url/to/django_view/"><button>See</button></a>
 }}}
 or
 {{{
 <a href='url/to/django/view' onClick='document.search_form.submit()'>
 }}}

 you're telling the browser to do 2 things in this order :

  * Handle the javascript code (and do POST)
  * Navigate to a new url (and do GET)

 Use Firebug or look at Django console logs, you'll see the POST then the
 GET.
 Django will handle the 2 requests without problem but the browser is
 waiting for 2 threads.

 If browser was serializing threads (which is not what threads are made
 for), you wouldn't see any broken pipe.
 But sometimes, the "GET thread" answers before the "POST thread", so the
 browser considers this is the "thread" to use and "considers" that the
 "POST thread" is useless, so it closes the connection, thus making Django
 raise "Broken Pipe".

 What you're seeing is just a side-effect of browser thread concurrency.

 Try to fix your html code like that :
 {{{
 <a href="javascript:document.search_form.submit();">See</a>
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8094#comment:8>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to