Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michael McAiney 14 posts 33 karma points
    Jan 20, 2011 @ 20:18
    Michael McAiney
    0

    JavaScript Reference

    Hi All

    This is probably a simple one.

    I have the following structure...

    Masterpage

    Page 1

    Sub Page 1

    Page 2

    Page 3

    Page 4

    In the masterpage I have this reference to a javascript file.

    It works fine when looking at page 1 but stops working when I enter Sub Page 1.

    <script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script

    Having simlar problems referencing images and other such things as well

    <img src="media/images/logo.png" alt="">

    Cheers for any help

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 20, 2011 @ 20:20
    Kim Andersen
    1

    Hi Michael.

    I think you just need to insert a / in front of the paths. Like this:

    <script type="text/javascript" src="/scripts/jquery-1.3.2.min.js"></script>

    <img src="/media/images/logo.png" alt="">

    /Kim A

     

  • Michael McAiney 14 posts 33 karma points
    Jan 20, 2011 @ 20:24
    Michael McAiney
    0

    Didn't work :(

    Thanks for the reply though

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 20, 2011 @ 20:31
    Kim Andersen
    0

    Hmm.. that's weird. When you say that it stops working, do you then mean that the line is not at all in the source code or can the browser just not find the file?

    Maybe you could try posting the content of your templates so that we can see how things look.

    /Kim A

  • Michael McAiney 14 posts 33 karma points
    Jan 20, 2011 @ 21:17
    Michael McAiney
    0

    This site is here while being developed:  http://84.45.121.89/EPT/

    If you Click on "Courses" that is Page 1 and then choose a Course and that is the Sub Page which is not working.

    MASTERPAGE:

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head id="head" runat="server">
        
        <title>Home page</title>
        <meta charset="utf-8">
        <meta name="description" content="Your description">
        <meta name="keywords" content="Your keywords">
        <meta name="author" content="Your name">
        <link href="../css/reset.css" rel="stylesheet" type="text/css" />
        <link href="../css/grid.css" rel="stylesheet" type="text/css" />

        <link href="../css/style.css" rel="stylesheet" type="text/css" />
        <link href="../css/prettyPhoto.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="scripts/script.js"></script>
        <script type="text/javascript" src="scripts/cufon-yui.js"></script>
        <script type="text/javascript" src="scripts/Myriad_Pro_400.font.js"></script>
        <script type="text/javascript" src="scripts/Myriad_Pro_900.font.js"></script>
        <script type="text/javascript" src="scripts/Myriad_Pro_400r.font.js"></script>
        <script type="text/javascript" src="scripts/cufon-replace.js"></script>

        <!--[if lt IE 9]><script type="text/javascript" src="scripts/html5.js"></script><![endif]-->
        <!--[if IE]><link href="../css/ie_style.css" rel="stylesheet" type="text/css" /><![endif]-->
        <!--[if lt IE 7]><script type="text/javascript" src="http://info.template-help.com/files/ie6_warning/ie6_script_other.js"></script><![endif]-->

      
       </head>
    <body>

      
      <div id="main">
        <!-- header -->
        <header>

            <div class="block-1">  
              <div class="logo"><href="http://84.45.121.89/EPT/"><img src="media/images/logo.png" alt=""></a></div>       
                <nav>
                      <!--[if gte IE 7]>
                      <umbraco:Macro Alias="Navigation" runat="server"></umbraco:Macro>
                      <![endif]-->
                      <!--[if lt IE 7]>
                      <umbraco:Macro Alias="Navigation_Safe" runat="server"></umbraco:Macro>
                      <![endif]-->
                      <![if ! IE]>  
                      <umbraco:Macro Alias="Navigation" runat="server"></umbraco:Macro>
                      <![endif]>    
                  </nav>
            </div>
        </header>
        <!-- content -->
        <section id="content">      
          
          
      <form id="RunwayMasterForm" runat="server">
        <asp:ContentPlaceHolder ID="MasterpageContentPlaceHolder" runat="server"></asp:ContentPlaceHolder>
      </form>  
            
        </section>
      </div>
      <!-- footer -->
      <footer>
        <div class="container">
          <div class="indent">
              <div class="wrapper">
                <div class="fright">
                  <span>Extreme Physical Training</span&copy; 2011 &nbsp; &nbsp; <href="index-6.html">Privacy Policy</a>
                </div
                 <div class="fleft"><!-- {%FOOTER_LINK} --></div>
              </div>
          </div>
        </div>
    </footer>

     
    </body>
    </html>



    </asp:Content>

     

     

    COURSE TEMPLATE:

     

    <%@ Master Language="C#" MasterPageFile="~/masterpages/Masterpage.master" AutoEventWireup="true" %>

    <asp:content ContentPlaceHolderId="MasterpageContentPlaceHolder" runat="server">
      
          
          
          <!-- main banner begin -->  
          <div class="main-banner">
              <div class="indent-banner">              
                    <span>Our Fitness Center</spanoffers a 
                    choice of accessories for your swim, 
                    sports gear and personal care 
                    products &amp; nutritions. <br>
                    Our trainers are masters of sport.    
                
                </div>
            <img alt="" src="media/images/img1.jpg" />       
              <href="more.html" class="icon_1"&nbsp;</a>            
          </div>
          <!-- main banner end -->      
         <!-- .content-box -->

        <!-- content -->
        <section id="content">
          <!-- .content-box -->
          <div class="content-box-1">
            
            <div class="container_16">
              <!-- Full widht -->
              <div class="wrapper">
                <div class="grid_16">
               <umbraco:Macro Alias="CourseList" runat="server"></umbraco:Macro>
      
         </div>
      </div>
           </div>
          </div>
         <!-- /.content-box -->
      </section>
      
    </asp:content>

     

    COURSE ITEM TEMPLATE:

     

    <%@ Master Language="C#" MasterPageFile="~/masterpages/Masterpage.master" AutoEventWireup="true" %>

    <asp:content ContentPlaceHolderId="MasterpageContentPlaceHolder" runat="server">
      
    </asp:Content>

     

    Thanks for any help

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Jan 20, 2011 @ 21:28
    Chriztian Steinmeier
    1

    Hi Michael,

    You need to provide absolute paths as Kim is saying; only your scripts etc. seem to reside in the EPT folder, so you should reference that:

    <script src="/EPT/scripts/etc.js"><script>

    /Chriztian 

  • Michael McAiney 14 posts 33 karma points
    Jan 20, 2011 @ 21:31
    Michael McAiney
    0

    Ah right!!!  /EPT/    I was just doing /SCRIPTS/

    Thanks a lot to both of you for your help!!!

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Jan 21, 2011 @ 00:17
    Chriztian Steinmeier
    0

    You're absolutely welcome - I'll tell you, I was scrathing my head as to why everything loaded fine on the courses.aspx page even; given I could see with my own eyes you were using relative paths :-) Just so used to fixing that going from prototype HTML to implemented in Umbraco, that I knew Kim was right - it just didn't work :-)

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft