Results 1 to 9 of 9

Thread: Menu external html css xhtml script

  1. #1
    Join Date
    Mar 2010
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Menu external html css xhtml script

    Hello to all,

    I'm looking for, if it's possible a menu, but I'm needing it to have the url links on an external file, such as css,html,xhtml etc BUT NOT PHP etc.

    Why! you may be asking yourself

    Well, the reason is so I can update my menu, by updating one external file and not having to update all my html pages.

    I know about an <iframe> with a externel html to be displayed within the <iframe> but I've had some trouble with iframes before with some browser's not displaying.

    I've see some image scripts with externel css with image/alt/link code, so I'm hoping for a clickable text/link code within css and to link css in html to display the css clickable text/link.

    If anyone would like to point me in the right direction or to give me the bad news of it's not possible.

    Note: menu need to be vertical and search friendly

    Thanks for looking
    Last edited by Wakel; 03-12-2010 at 05:45 AM.

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    I don't understand what you want. Just a way to include a menu on every page of your site?
    ===
    Arie Molendijk.

  3. #3
    Join Date
    Mar 2010
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by molendijk View Post
    I don't understand what you want. Just a way to include a menu on every page of your site?
    ===
    Arie Molendijk.
    Thanks for your reply,

    Within the css file something like this:

    <script type="text/javascript">
    menulink[0]='<a href="http://">Link 1</a>'
    menulink[1]='<a href="http://">Link 2</a>'
    menulink[2]='<a href="http://">Link 3</a>'
    menulink[3]='<a href="http://">Link 4</a>'
    menulink[4]='<a href="http://">Link 5</a>'
    </script>

    and then within the html/xhtml file a code like this:

    <head>
    <link rel="stylesheet" type="text/css" href="menu.css" />
    </head>
    <body>
    <div id="menu" class="menu">
    script goes here
    <div>


    PLEASE NOTE: the above code is just an example

    This way, when I want to update the menu links, all I have to do is to edit one css file and dont have to edit every html/xhtml file
    Many thanks

  4. #4
    Join Date
    Mar 2010
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hello again

    I've been working on this script below, this may help explain what I'm needing better.
    Below you'll see html file code and js file code, both of which makes up a drop down menu with links. Links are within the js file and not the html file.
    I'm needing simular file, but for just a menu(not drop down) text, images or link.

    html file:
    *********************

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <META NAME="Generator" CONTENT="TextPad 4.6">
    <META NAME="Author" CONTENT="?">
    <META NAME="Keywords" CONTENT="?">
    <META NAME="Description" CONTENT="?">
    </HEAD>

    <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">


    <script src="./chgoto.js" language="JavaScript" type="text/javascript"></script>


    </BODY>
    </HTML>

    *********************

    js file:
    *********************


    function menu_goto( menuform )
    {

    var baseurl = 'http://freelaptopmanuals.com/' ;
    selecteditem = menuform.url.selectedIndex ;
    newurl = menuform.url.options[ selecteditem ].value ;
    if (newurl.length != 0) {
    location.href = baseurl + newurl ;
    }
    }
    document.writeln( '<form action="chgoto" method="get">' );
    document.writeln( '<select name="url" onchange="menu_goto(this.form)">' );
    document.writeln( '<option value="default.aspx">Home</option>' );
    document.writeln( '<option value="laptop_manuals.html">Laptop Manuals</option>' );
    document.writeln( '<option value="info_guides.html">Info Guides</option>' );
    document.writeln( '<option value="laptop_support_forum.html">Laptop Support Forum</option>' );
    document.writeln( '<option value="free_laptop_service_user_manual_search.html">Search</option>' );
    document.writeln( '<option value="advertise.html">Advertise</option>' );
    document.writeln( '<option value="contact_us.html">Contact Us</option>' );
    document.writeln( '</select>' );
    document.writeln( '</form>' );

    **********************************************************

  5. #5
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    js file for including menu.html. Call the js file: include_menu.js:
    Code:
    function include(url){
    var pageRequest = false //variable to hold ajax object
    /*@cc_on
    @if (@_jscript_version >= 5)
    try {pageRequest = new ActiveXObject("Msxml2.XMLHTTP")}
    catch (e){try {pageRequest = new ActiveXObject("Microsoft.XMLHTTP")}
    catch (e2){pageRequest = false}}
    @end
    @*/
    
    if (!pageRequest && typeof XMLHttpRequest != 'undefined')
    pageRequest = new XMLHttpRequest()
    
    if (pageRequest){ //if pageRequest is not false
    pageRequest.open('GET', url,false) //get page synchronously
    pageRequest.send(null)
    
    document.write(pageRequest.responseText);
    }
    }
    include('menu.html')
    In menu.html: anything you want. Put some text in it to test.

    In each page in which you want to include menu.html, something like:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    <title></title>
    </head>
    
    <body>
    <div>
    This is text from your main page<br>
    <script type="text/javascript" src="include_menu.js"></script>
    </div>
    </body>
    
    </html>
    ===
    Arie Molendijk.

  6. The Following User Says Thank You to molendijk For This Useful Post:

    Wakel (03-12-2010)

  7. #6
    Join Date
    Mar 2010
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thank you molendijk, your a star

    One question about your js file!

    Is it Search engine friendly? Will search engine's find html file i.e.
    include('menu.html')
    from within your js file?

    Many thanks again for all your help

  8. #7
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    The included content is invisible to Google, I'm afraid.
    ===
    Arie

  9. The Following User Says Thank You to molendijk For This Useful Post:

    Wakel (03-12-2010)

  10. #8
    Join Date
    Mar 2010
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by molendijk View Post
    The included content is invisible to Google, I'm afraid.
    ===
    Arie
    I've found this menu script http://dynamicdrive.com/dynamicindex1/slideinmenu4.htm and just to ask if this is more Gooogle friendly?
    i.e. will the menu.html file be searchable?

  11. #9
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    I don't think so. Ajax-includes are not searchable (I think).
    ===
    Arie.

  12. The Following User Says Thank You to molendijk For This Useful Post:

    Wakel (03-14-2010)

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
  •