Hi Dan,

Ah, okay, that actually has nothing to do with evalScripts or loading
scripts dynamically. :-)

You'll have to talk to the Greybox folks. (I've never heard of it.)
My *guess* is that Greybox is looking for anchor tags with that kind
of REL attribute at page load time and attaching handlers to them (the
snippet you quoted doesn't have any handlers, so they must be doing it
another way), and so new elements added *after* page load (via
Ajax.Updater, Element#update, etc.) don't get handled because Greybox
has alredy done its anchor search.  I'm sure they provide some
function you can call to say "Hey, look, there's a new anchor here!"
-- which you would put in script tags in the fragment, which will get
evaluated by evalScripts.  E.g., something like this (*NOT* this, talk
to the Greybox folks):

    <a href="showStuff.php"
       title="Title for PopUP'"
       rel="gb_page_center[540, 380]">When you click this link a popup
will show up</a>
    <script>greybox_load_new_stuff_or_something();</script>

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


On Feb 24, 4:35 am, Recourse Records <recoursereco...@gmail.com>
wrote:
> thanks for the reply. However, it still doesn't work. let me just write out
> an idea of what im trying to get done. This is without the method on the
> wiki. Let's start from the original issue and work thru it from there
>
> So...
>
> ::This is what's included on each page to get the GreyBox pop up box to
> work::
>
> :::index.php:::
> ----------------------------------------------------------------------
> <head>
>
> <script src="libraries/prototype.js" type="text/javascript"></script>
>
>  <script type="text/javascript">
>     var GB_ROOT_DIR = "./GreyBox_v5_5_3/greybox/";
> </script>
>
> <script type="text/javascript" src="GreyBox_v5_5_3/greybox/AJS.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" />
>
> </head>
>
> <div id="container"></div>
>
> <script type="text/javascript>
> new Ajax.Updater('container', 'example.php', {evalScripts:true});
> </script>
>
> ----------------------------------------------------------------------
>
> example.php
> ----------------------------------------------------------------------
> <!--This is how GreyBox works. It's all in the rel attribute-->
>
> <a href="showStuff.php" title="Title for PopUP'" rel="gb_page_center[540,
> 380]">When you click this link a popup will show up</a>
> ----------------------------------------------------------------------
>
> So.. the above anchor tag should be put into the container div. That anchor
> tag triggers the GreyBox javascript stuff in the <head> tags. So....how do I
> get this to work?
>
> I just want to make it more clear to you of what my issue is.
>
> If you don't mind, please supply the code to the solution, if it won't take
> you too long.
>
> I really appreciate you working with me. There is obviously something I'm
> not grasping. Sorry.
>
> Thanks,
> Dan
>
> On Mon, Feb 22, 2010 at 1:34 AM, T.J. Crowder <t...@crowdersoftware.com>wrote:
>
>
>
> > 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><prototype-scriptaculou
> > s%2bunsubscr...@googlegroups.com <s%252bunsubscr...@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<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