[Twisted-Python] Woven (microdom?) problem

Eric Holm twisted at eholm.com
Thu May 8 21:42:04 EDT 2003

I'm having some trouble with the following (at the very
end of this mail) Woven script/html.  My problem is
that the line:

<script language="JavaScript" src="Refresh.js"></script>

is re-written by Woven (microdom?) to:

<script language="JavaScript" src="Refresh.js" />

which apparently isn't kosher (at least as far as
IE and Opera are concerned).  If I point my browser to
Minimal.html, it works fine, if I point it to
Minimal.rpy, the browser barfs due to the rewrite.

I'm using Twisted 1.0.3 on Win2k, Python 2.2.
Any help would be most appreciated.



*** Minimal.html:
<script language="JavaScript" src="Refresh.js"></script>

<body onload="doLoad()">
The time is: <span model="TimeTest" view="Text">hh:mm:ss</span>

*** Minimal.rpy:
from twisted.web.woven import model, page, widgets
import time

model = model.AttributeModel()
model.setSubmodel( "TimeTest", time.asctime() )

resource = page.Page(model, templateFile="Minimal.html")

*** Refresh.js (FWIW):
var sURL = unescape(window.location.pathname);

function doLoad()
    setTimeout( "refresh()", 10*1000 );

function refresh()
    window.location.href = sURL;

More information about the Twisted-Python mailing list