Thanks for the responses.  I changed the paths as suggested to:

<script type="text/javascript" src="../scriptaculous/lib/
prototype.js"></script>
<script type="text/javascript" src="../scriptaculous/src/effects.js"></
script>

The error still persists, however.  Maybe my use of relative paths is
in correct.  The user control where the js lives is /webroot/controls/
user.control.ascx.  The scriptaculous js files are at /webroot/
scriptaculous/lib/prototype.js and /webroot/scriptaculous/src/
effects.js.

How do I "set up the path to not attempt to use automatic paths"?
Thanks.

byron

On Jul 25, 9:45 pm, "Jerod Venema" <[EMAIL PROTECTED]> wrote:
> Martin nailed it. The ~/ is only valid for items with a runat="server"
> attribute (and you can't stick that on js includes, or ASP attempts to
> compile your javascript).
>
> Either 1) set up the path to not attempt to use automatic paths (ie, use ../
> instead of ~/) or 2) do the include in your code-behind file.
>
> -Jerod
>
> On 7/25/07, Martin Ström <[EMAIL PROTECTED]> wrote:
>
>
>
> > Is this on a windows box? (since you're using .net controls). It was a
> > while since I used IIS but afaik there could be problems when using
> > paths starting with ~, couldnt it?
>
> > Try to reduce the page to just one element an run effect on that. But
> > if Effect is undefines then you're problably having problems with the
> > path to scriptaculous.js
>
> > Cheers
> > Martin
>
> > On 25/07/07, byronfromwesleyan <[EMAIL PROTECTED]> wrote:
>
> > > Hi.  I'm trying to apply a fade effect with the following code, but I
> > > keep getting the error in the subject line.  Help is appreciated.
> > > Thanks!
>
> > > Here's the code:
>
> > > [CODE]
> > > <script type="text/javascript" src="~/scriptaculous/lib/
> > > prototype.js"></script>
> > > <script type="text/javascript" src="~/scriptaculous/src/effects.js"></
> > > script>
> > > <script type="text/javascript">
> > >         var mainImgNum = 1;
>
> > >  function rotateDisplay()
> > >  {
> > >         if(mainImgNum == 1)
> > >         {
> > >                 mainImgNum = 2;
> > >         }
> > >         else if(mainImgNum == 2)
> > >         {
> > >                 mainImgNum = 3;
> > >         }
> > >         else
> > >         {
> > >                 mainImgNum = 1;
> > >         }
>
> > >         new Effect.Fade('col', { queue: { position:'end',
> > scope:'fader'},
> > >                 afterFinish: function()
> > >                 {
> > >                         $('col').src =
> > 'images/billboard_'+mainImgNum+'.gif';
> > >                         Element.removeClassName('btn1','btnBottomCMS');
> > >                         Element.removeClassName('btn2','btnBottomCMS');
> > >                         Element.removeClassName('btn3','btnBottomCMS');
> > >                         new Effect.Appear('col', {queue: {position:
> > > 'end',scope:'fader'} });
> > >                         Element.addClassName
> > ('btn'+mainImgNum,'btnBottomCMS_active');
>
> > >                 }});
>
> > >  }
>
> > >  function showGraph()
> > >  {
> > >         var val = Math.floor(Math.random()*3);
>
> > >         if(val == 0)
> > >         {
> > >      document.write("<h3 class=\"network_reach\"><span>Network Reach</
> > > span></h3>    <div><img src=\"images/nr_graph.png\" /></div>    <p>We
> > > have maintained the largest online reach for 31 consecutive months -
> > > currently reaching over <strong>85% of the Internet universe</strong>,
> > > according to comScore Media Metrix, December 2006.</p>");
> > >         }
> > >         else if(val == 2)
> > >         {
> > >      document.write("<h3 class=\"top_advertisers\"><span>Top
> > > Advertisers</span></h3>    <div><img src=\"images/nr_graph.png\" /></
> > > div> <p>We have worked with <br/><strong>9 out of the top 10</strong>
> > > online advertisers, according to Ad Age.</p>");
> > >         }
> > >         else
> > >         {
> > >      document.write("<h3 class=\"top_agencies\"><span>Top Agencies</
> > > span></h3>    <div><img src=\"images/nr_graph.png\" /></div>    <p>We
> > > have worked with <br/><strong>16 out of the top 20 agencies</strong>,
> > > according to Ad Age.</p>");
> > >         }
> > >  }
>
> > >   onload = function()
> > >  {
> > >   //externalLinks();
> > >   var interval_name = setInterval(rotateDisplay, 6000);
> > >  }
> > >  </script>
>
> > > <div  id="home">
> > >   <div class="left_col">
> > >     <div class="col">
> > >     <asp:LinkButton id="btn1" PostBackUrl="~/LearnMore.aspx?
> > > section=goverview" text="<%$ Resources:DefaultMasterResources,
> > > GuaranteedCPMsHeader %>"
> > >             CssClass="btnBottomCMS" Width="180px" runat="server" Font-
> > > Size="smaller" />
> > >       <p><asp:Label ID="lblGuaranteed" Text="<%$
> > > Resources:DefaultMasterResources, GuaranteedCPMs %>" runat="server" /
> > > ></p>
> > >     </div>
> > >     <div class="col">
> > >     <asp:LinkButton id="btn2" PostBackUrl="~/LearnMore.aspx?
> > > section=invcontrol" text="<%$ Resources:DefaultMasterResources,
> > > InventoryControlHeader %>"
> > >             CssClass="btnBottomCMS" Width="180px" runat="server" Font-
> > > Size="smaller" />
> > >       <p><asp:Label ID="lblInventory" Text="<%$
> > > Resources:DefaultMasterResources, InventoryControl %>" runat="server" /
> > > ></p>
> > >     </div>
> > >     <div class="col last_col">
> > >     <asp:LinkButton id="btn3" PostBackUrl="~/LearnMore.aspx?
> > > section=qadv" text="<%$ Resources:DefaultMasterResources,
> > > QualityAdvertisersHeader %>"
> > >             CssClass="btnBottomCMS" Width="180px" runat="server" Font-
> > > Size="smaller" />
> > >       <p><asp:Label ID="lblQuality" Text="<%$
> > > Resources:DefaultMasterResources, QualityAdvertisers %>"
> > > runat="server" /></p>
> > >     </div>
> > >   </div>
> > >   <div class="right_col">
> > >         <script type="text/javascript">showGraph();</script>
> > >   </div>
> > > </div>
> > > [/CODE]
>
> > --
> > burnfield.com/martin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to