www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: page help

  1. #1
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602

    Exclamation page help shared borders?

    hi i have the following coding that i wish to put on the bottom of each page of my site

    <p align="center"><font color="ffffff">
    <script language="javascript" src="quotes.js"></script></p>

    <p align="center">
    <script language="javascript" src="mistake.js"></script>
    <script language="javascript" src="suggestions.js"></script>
    <script language="javascript" src="vote.js"></script>
    <script language="javascript" src="log.js"></script>
    <script language="javascript" src="glossary.js"></script>
    <script language="javascript" src="bookmark.js"></script>

    <a href="javascript:openMistake()">Seen A Mistake</a>&nbsp;&nbsp;
    <a href="javascript:openSuggestions()">Make A Suggestion</a>&nbsp;&nbsp;
    <a href="javascript:openVote()">Vote</a>&nbsp;&nbsp;
    <a href="javascript:openLog()">See Web Log / Updates</a>&nbsp;&nbsp;
    <a href="javascript:openGlossary()">Glossary</a>&nbsp;&nbsp;
    <a href="guestbook.htm" target="_blank">Guestbook</a>&nbsp;&nbsp;
    <a href="search.htm" target="_blank">Search</a>
    </p>

    <p align="center">
    <a href="sitemap.htm" target="_blank">Site Map</a>&nbsp;&nbsp;
    <a href="#" onClick="this.style.behavior='url(#default#homepage)';
    this.setHomePage('http://www.whatever.com');">
    Make Us Your Homepage</A></font>&nbsp;&nbsp;
    <a href="javascript:bookmark()">Click Here To Bookmark</a>
    </p>

    would it be possible to have it appear at the bottom of each page without having to put it all in each pages coding?

    thanks
    Rich
    Last edited by 96turnerri; 09-14-2003 at 01:19 PM.
    Richard Turner - A Virtual Insight

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Yes, with PHP or SSI (and other serverside languages). Does your server support either of those technologies?

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  3. #3
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602
    php no, and ssi??
    Richard Turner - A Virtual Insight

  4. #4
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    SSI = Server Side Includes

    Do you have any serverside languages available?

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  5. #5
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Since you're using JavaScript anyway you could just put it all in a separate .js file like this:

    function writestuff(){

    document.write("C O D E");

    }


    in the head have:

    <script type="text/javascript" src="file.js"></script>


    and where you want the stuff written have this:

    <script type="text/javascript"><!--
    writestuff();
    //--></script>
    Every fight is a food fight when you’re a cannibal.

  6. #6
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Yes, but 13% of users do not hava JavaScript enabled, so that method will result in inaccessable pages...

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  7. #7
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Have you seen his code???

    The only thing I've spotted with no JavaScript in is this:

    <a href="sitemap.htm" target="_blank">Site Map</a>

    And he could always include that just by itself anyway.

    Edit: I've just seen these two as well:

    <a href="guestbook.htm" target="_blank">Guestbook</a>
    <a href="search.htm" target="_blank">Search</a>

    So that's 3/9999 then is it?
    Every fight is a food fight when you’re a cannibal.

  8. #8
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Either way, using a serverside language is best (and IMO, the only way it should be done)... http://www.w3.org/TR/WCAG10/wai-page...l#tech-scripts

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  9. #9
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    I agree that all web-developers should try to accomodate dis-abled users and users who are using old browsers or have JavaScript disabled.
    But in this case where clearly most of the content is created JavaScript anyway, what would be the point of using server side includes, only to include content that is JavaScript and could not be viewed by all of the types of users that I have listed above?

    Edit: I do not think that it would be inappropriate to include some suitable content in between some noscript tags.
    6.3 Ensure that pages are usable when scripts, applets, or other programmatic objects are turned off or not supported. If this is not possible, provide equivalent information on an alternative accessible page. [Priority 1]
    For example, ensure that links that trigger scripts work when scripts are turned off or not supported (e.g., do not use "javascript:" as the link target). If it is not possible to make the page usable without scripts, provide a text equivalent with the NOSCRIPT element, or use a server-side script instead of a client-side script, or provide an alternative accessible page as per checkpoint 11.4.
    Last edited by David Harrison; 09-14-2003 at 05:02 PM.
    Every fight is a food fight when you’re a cannibal.

  10. #10
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Originally posted by lavalamp
    what would be the point of using server side includes
    They (or PHP includes) work better. They can include plain text (or better, HTML markup) and you don't have to worry about escaping all the content like you would in JavaScript.

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  11. #11
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Sorry, but could you just give me clarification of what the word "escaping" means.
    I've heard it before, and I know that you can unescape something in JS as well, but I don't know what they mean/do.
    Every fight is a food fight when you’re a cannibal.

  12. #12
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602
    ok thanks for your help i have recomended that users have js enabled anyway and a page that tells them there resolution, java script enabled etc. gonna sound really stupid i no, but all i writes on the page is whatevers in here

    document.write("");

    which is obvious i no, but how would i get it to say what i want it to say?
    Richard Turner - A Virtual Insight

  13. #13
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602
    also i could get php but dont have a clue what it does or how to use it
    Richard Turner - A Virtual Insight

  14. #14
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    With javascript, you will have to use document.write, which means it will look something like this:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <script type="text/javascript" src="test.js"></script>
    </body>
    </html>
    and test.js

    Code:
    document.write('<div>',
    '<p>This is the first demo paragraph</p>',
    '<p>This is the second demo paragraph</p>',
    '</div>');
    Whereas with PHP, it would be like this:

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <?PHP
    include "test.txt";
    ?>
    </body>
    </html>
    and test.txt

    Code:
    <div>
    <p>This is the first demo paragraph</p>
    <p>This is the second demo paragraph</p>
    </div>
    With the PHP (or SSI) method, you can just use regular HTML in the included file, making it much easier, if you need to include a farily large amount of content.

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  15. #15
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602
    so basically what your saying is if i edited the one txt file (presuming i was using php and it was on all pages of web) all pages would be automatically updated? that sounds quite good i might have to start reading up on php. thanks again pyro
    Richard Turner - A Virtual Insight

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles