logo       

Re: How would you re-write this code to hide/show content: msg#00117

Subject: Re: How would you re-write this code to hide/show content
Here is one possibility:

   function processRequestChange()
   {
       if(request.readyState == 4)
       {
           var results = regex.exec(request.responseText);
           if(results) {
document.getElementById(results[2]).innerHTML = results[3];
           } else {
                 var bodyRegex = /<body>(.*)?<\/body>/;
var body = bodyRegex.exec(request.responseText);
                 if ( body ) {
                     document.body.innerHTML = body[1];
                 } else {
                            document.body.innerHTML = request.responseText;
                 }
           }
       }
   }




On Sat Jan 22 04:16:42 PST 2005, Avi Bryant <avi.bryant@xxxxxxxxx> wrote:

On Sat, 22 Jan 2005 04:06:06 -0800 (PST), Mike <me@xxxxxxxxxxxxx> wrote:
Wow, thats pretty clever!  It took me some time to understand all
the moving parts.

One thing: Initially I did not add renderDiv2On and renderDiv3On
methods, so I was not getting updates.  I modified
WAStandardScripts to print out the contents of
request.responseText, and I could then see that its a
doesNotUnderstand debug page.  Makes sense.  So liveUpdate is
swallowing debug pages.  Do you think this is correct?  Would it
not be better if liveUpdate alerted the user if an exception page
comes back, or just, more generally, if the regexp did not
succeed?

Yes, it certainly would - probably what it should do is just replace the body of the document with the resulting response. If anyone wants
to submit a modification that does that, that would be great.

Avi
_______________________________________________
Seaside mailing list
Seaside@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/listinfo/seaside





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe