Hi,

Where was that HTML? Because if it was in the page you're *loading*,
it still uses a script tag to reference an external file
(prototype.js) and then using things from it ($$).

If the things you're loading are under your control, provide a
`loadScript` function in your main page (that actually does the work,
as from the wiki page) that they can use like this:

    <script type="text/javascript">
    loadScript("MyexternalScriptFile.js");
    </script>

That inline script in the fragment loaded by Ajax.Updater will get
executed by `evalScripts`. Since it's executed in the context of your
page with your `loadScript` function, it has access to it, and the
external file gets loaded.

HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com


On Feb 21, 7:03 pm, Recourse Records <recoursereco...@gmail.com>
wrote:
> This syntax works when ajax.updater is not involved but it still doesn't
> work with ajax.updater. What am I doing wrong? I'm trying to reach a
> deadline :(
>
> On Sun, Feb 21, 2010 at 1:31 PM, Recourse Records <recoursereco...@gmail.com
>
>
>
> > wrote:
> > Thanks for replying. Ok, so going by page[3] if I were to do the
> > following...AJAX UPDATER would evaluate the external js files:
>
> > <head>
> > <script type="text/javascript" src='libs/prototype.js'></script>
>
> > var head;
> > var script;
>
> > head = $$('head')[0];
> > if (head)
> > {
> >     script = new Element('script', { type: 'text/javascript', src:
> > 'GreyBox_v5_5_3/greybox/AJS.js' });
> >     head.appendChild(script);
> > }
>
> > </head>
>
> > Did I get it right?
>
> > On Sun, Feb 21, 2010 at 2:04 AM, T.J. Crowder 
> > <t...@crowdersoftware.com>wrote:
>
> >> Hi Dan,
>
> >> > NOW, every-time I do a AJAX.UPDATER...it doesn't do what it's suppose
> >> > to. IN OTHER WORDS: It's acting like those declarations are not declared
> >> > in the header.
>
> >> It's actually doing what it's documented[1] to do: "<script> blocks
> >> referencing external files will be treated as though they were
> >> empty...external files are not loaded and processed by evalScripts."
> >> I'm not saying they shouldn't be, just that they aren't and the
> >> behavior is documented.
>
> >> This came up just a few days ago[2]. As I mentioned in that thread, at
> >> the moment you have to find the script tags yourself and load them;
> >> this page[3] on the unofficial wiki talks about the process of
> >> dynamically loading scripts.
>
> >> [1]
> >>http://api.prototypejs.org/language/string.html#evalscripts-instance_...
> >> [2]
> >>http://groups.google.com/group/prototype-scriptaculous/browse_thread/...
> >> [3]
> >>http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami...
>
> >> HTH,
> >> --
> >> T.J. Crowder
> >> Independent Software Consultant
> >> tj / crowder software / com
> >>www.crowdersoftware.com
>
> >> On Feb 21, 6:39 am, Dan <recoursereco...@gmail.com> wrote:
> >> > I have some <script> tags in my header tags that's used all throughout
> >> > my site. In particular, they are script tags to a pop-up box:
>
> >> > <script type="text/javascript" src="GreyBox_v5_5_3/greybox/AJS.js"></
> >> > script>
> >> > <script type="text/javascript" src="GreyBox_v5_5_3/greybox/
> >> > AJS_fx.js"></script>
>
> >> > <script type="text/javascript" src="GreyBox_v5_5_3/greybox/
> >> > gb_scripts.js"></script>
> >> > <link href="GreyBox_v5_5_3/greybox/gb_styles.css" rel="stylesheet"
> >> > type="text/css" media="all" />
>
> >> > The way to have the popup box show up is to write out a link like so
> >> > <a href="URL" title="CAPTION" rel="gb_image[]">HTML</a>
>
> >> > NOW, every-time I do a AJAX.UPDATER and I update the container with a
> >> > link like the one above, it doesn't do what it's suppose to. IN OTHER
> >> > WORDS: It's acting like those declarations are not declared in the
> >> > header.
>
> >> > How can I make this work? I know it has something to do with
> >> > EvalScripts. Please help I am lost.
>
> >> > Thanks,
> >> > Dan
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Prototype & script.aculo.us" group.
> >> To post to this group, send email to
> >> prototype-scriptacul...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> prototype-scriptaculous+unsubscr...@googlegroups.com<prototype-scriptaculou
> >>  s%2bunsubscr...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to