[Twisted-web] Re: LivePage client.set()

Dave Cook daverz at gmail.com
Tue Mar 22 02:03:01 MST 2005


Here's a simple example (attached).

This doesn't work at all in IE 6.  I think the issue is that
document.innerHTML is not standard.

I ended up writing a Javascript function that accepts the option text as lines:

    myfuncs = T.script(language="javascript")[
        T.xml("""

        function setOptions(selectID, optionsString) {
            select = document.getElementById(selectID)
            select.options.length = 0
            optionList = optionsString.split(/\\n/)
            for (i=0; i < optionList.length; i++) {
                option = document.createElement("option")
                option.text = option.value = optionList[i]
                select.appendChild(option)
            }
        }
        """)]

Dave Cook
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clientset.py
Type: application/x-python
Size: 952 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050322/4a3bfb0b/clientset.bin


More information about the Twisted-web mailing list