• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WOComponent children
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOComponent children


  • Subject: Re: WOComponent children
  • From: Mike Schrag <email@hidden>
  • Date: Wed, 16 Jan 2008 20:00:16 -0500

    document.write('<script type="text/_javascript_" src=""color: #000000">+libraryName+'"></script>');
So document.write clobbers the document that you're in if it evals outside of onload, but it appears to actually look pretty good if I instead load the _javascript_ file as an Ajax.Request with an evalScripts: true.  There are some semantics that are different with this in terms of order of evaluation, but it looks hopeful.  It might be the case that to make it generally work reliably that it will require a synchronous request so the js loads prior to your component trying to render anything that might touch the js scope.
Yeah, asynchronous: false seems to give better behavior here ... It blocks loading the _javascript_, which is more like what the browser would do normally, and it also makes caching perform better because multiple components that include the same _javascript_ file don't enter a race condition resulting in loading the file multiple times (which doesn't usually cause a problem, but it's just chattier than normal).  I think a little bit more hackery with associating previously loaded _javascript_ files with the page component (to pickup files that were loaded in previous non-ajax requests to prevent generating this code at all) and it's probably close.  I have some Real Work (TM) to do, so I'll come back to this, but barring something terrible cropping up, look for this maybe next week.

ms
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: WOComponent children (From: email@hidden)
 >Re: WOComponent children (From: Mike Schrag <email@hidden>)
 >Re: WOComponent children (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: WOComponent children
  • Next by Date: Re: Chapter 11 in Practical WebObjects
  • Previous by thread: Re: WOComponent children
  • Next by thread: Entity Modeler + Veogen problems and questions
  • Index(es):
    • Date
    • Thread