[Phpmyadmin-devel] document.write() and jQuery conflicts on the demo server

Ninad Pundalik ninadsp16289 at gmail.com
Thu Jul 1 19:55:31 CEST 2010


Hi,

Since yesterday, I've been trying to figure out what has been causing
the blank pages on the 'Add New User' and 'Create Table' actions on
the demo server [0] (while it works fine on my system).  I've narrowed
it down to two calls to document.write(), which are a part of the
Google Analytics and Piwik code.  When jQuery inserts content
retrieved over an Ajax call into the DOM, it evaluates the inline
javascript. [1]

One possible, partial solution is to do what John Resig has shown in
this blogpost [2], to write a more compliant document.write()
function.  However, he admits that this is only a partial solution and
is not cross-browser.  I've been trying to hack around, but I've not
been successful in resolving this issue.  Has anyone come across a
better solution?

-----------------------------------------------------
[0] - http://demo.phpmyadmin.net/gsoc-ninadsp/
[1] - http://api.jquery.com/jQuery.ajax/ (documentation for the
dataType parameter explains how inline JS is handled)
[2] - http://ejohn.org/blog/xhtml-documentwrite-and-adsense/
-----------------------------------------------------

Ninad S. Pundalik
Twitter: @ni_nad | Identica : @ninad | http://ninadpundalik.co.cc/blog
GPG Key Fingerprint: 2DF7 B856 C75E C9F9 0504 C0EF D456 1946 7C45 2C69




More information about the Developers mailing list