SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    vi
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Help write out my javascript on the page no .js file

    Hlep me get my Javascript to on the page.

    I have my script as
    <script menumaker src="/_layouts/1033/styles/ACS/CUST/Theme/Menu/ACSBLW_ps.js"></script>

    But I want the entire script to be on the same page as regular Javascript:
    <Script text/language>
    code

    </script>

    Here is what some of the code in the js file looks like.

    Code:
    if(typeof(loc)=="undefined"||loc==""){var loc="";if(document.body&&document.body.innerHTML){var tt=document.body.innerHTML;var ml=tt.match(/["']([^'"]*)ps.js["']/i);if(ml && ml.length > 1) loc=ml[1];}}
    
    
    
    document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"menu/menu_gen.css\">");
    
    // CUSTOM THEME. To generate ACS_theme_gen.css customize and call thememaker() in xaramenu.js
    document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/_layouts/1033/Styles/ACS/CUST/Theme/Internal/ACS_theme_gen.css\">");
    
    
    
    
    var site_name = document.getElementById("siteURL").value
    
    var site_root = "RootFolder=%2FSCTR%2FACSBLB%2FACSBLW%2f"
    var doclib_name = "DL";
    var root = site_root + doclib_name;
    //var view = "&View=%7BEF8E82D2%2DF50D%2D479F%2D921C%2D1F57B2644843%7D";
    //var doclib_path_TV = "doclib/Document%20Library/Forms/AllItems.aspx?" + root
    var doclib_path_Def = doclib_name + "/Forms/AllItems.aspx?" + root;
    var doclib_path_TV = "WPs/doclib.aspx?" + root; // + "%2F1%20Main%20library"
    
    doclib_name = "Internal%20Document%20Library";
    root = site_root + doclib_name;
    var int_view = "&View=%7b58C59F55%2dF115%2d4328%2dBBD3%2dA8B1C64968C9%7d";
    var int_doclib_path_Def = doclib_name + "/Forms/AllItems.aspx?" + root;
    var int_doclib_path_TV = "WPs/intdoclib.aspx?" + root;
    
    doclib_name = "Approved%20Deliverables";
    root = site_root + doclib_name;
    var ADs_view = ""
    var ADs_doclib_path_Def = doclib_name + "/Forms/AllItems.aspx?" + root;
    var ADs_doclib_path_TV = "WPs/ADs_doclib.aspx?" + root;
    
    var mi_longest_name = "<longest menu item name in the group to set width>"
    var fs = 8 // font-size
    var sIssuesPath = "Issues"; //"Issues%20Action%20Items%20and%20Parking%20Lot%20Items";
    var sAIPath = "Action%20Items";
    var sPLIPath = "Issues%20Action%20Items%20and%20Parking%20Lot%20Items"; //"Parking%20Lot%20Items";

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why would you want to do that? It's better from a performance point of view to keep the JavaScript in its own file so the browser can cache it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •