Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts

    Exclamation No time, all the time!

    I cannot get the webpage to put up the two clocks.
    <script type="text/javascript" src="ind2clox.js"></script>

    I'm getting desperate.

    http://www.exitfegs.co.uk/openpage.html
    http://www.exitfegs.co.uk/openpagestyles.css

    any help please.

    effpeetee

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    I do not find a javascript file at http://www.exitfegs.co.uk/ind2clox.js nor a reference to the clocks ids '#clockbox0' '#clockbox1' in the html

  • #3
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Quote Originally Posted by rwedge View Post
    I do not find a javascript file at http://www.exitfegs.co.uk/ind2clox.js nor a reference to the clocks ids '#clockbox0' '#clockbox1' in the html
    <!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" xml:lang="en">
    <head>
    <meta http-equiv="Refresh" content="45" />
    <link rel="stylesheet" type="text/css" href="openpagestyles.css" />
    <title>Website/Page Title</title>
    <script type="text/javascript" src="ind2clox.js"></script>
    <script type="text/javascript" src="imageswap.js"></script>
    </head>
    <body>
    <div id="wrap">
    <div id="header">
    <h1>Page title</h1>
    </div>
    <div id="content">

    This is the beginning of the HTML program.

    And here is the beginning of the style sheet.
    #clockbox0{
    position: absolute;
    color:white
    }

    #clockbox1{
    position: absolute;
    right: 1em;
    color:white }

    #wrap {
    position: relative;
    width: 1000px;
    margin: 1 auto;
    }


    body {
    background-color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    color: white;
    font-weight: bold;
    font-size:12px
    }


    Is this wrong. I thought that the latter should/could be in the style sheet.

    Be wary, not to click the picture in the HTML.
    It is programmed to direct you to a simlar page which is not relevant.

    ind2clox.js is on the site. I have just checked it.


    effpeetee.
    Last edited by effpeetee; 05-08-2007 at 01:31 PM.

  • #4
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    You can use style to control the looks and position, but then you need to add the clock division/span to the html
    Code:
    #clockbox0{
    position: absolute; 
    color:white
    }
    
    then in the html, the 'target' of the css:
    
    <div id="clockbox0">  </div>

  • #5
    Regular Coder kosstr12's Avatar
    Join Date
    Apr 2007
    Location
    Woodstock, Georgia
    Posts
    428
    Thanks
    7
    Thanked 5 Times in 5 Posts

    Just letting you know

    I just thought you might want to know, on http://www.exitfegs.co.uk/xmas2006.html the text from the picture, and the text on the page are to the point where you cant read them

  • #6
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Quote Originally Posted by rwedge View Post
    You can use style to control the looks and position, but then you need to add the clock division/span to the html
    Code:
    #clockbox0{
    position: absolute; 
    color:white
    }
    
    then in the html, the 'target' of the css:
    
    <div id="clockbox0">  </div>
    Thanks. I have done some modifications to the page, but they do not work.
    If you look at my index page, you will find that the procedure there works fine. I can't see why it does not work in this "openpage"

    index page here.

    www.exitfegs.co.uk
    Last edited by effpeetee; 05-08-2007 at 02:42 PM.

  • #7
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by effpeetee View Post
    Thanks. I have done some modifications to the page, but they do not work.
    If you look at my index page, you will find that the procedure there works fine. I can't see why it does not work in this "openpage"

    index page here.

    www.exitfegs.co.uk
    As you were told initially, you still have no element with the id 'clockbox', to which the script expects to write. Normally this would cause an error, however the clock script cannot run because it is triggered in an onload handler that is overwritten by your image swap script.
    You need to comment-out the window.onload assignment in both scripts, and include both function calls in an onload handler preferably in the document itself.

    <body onload="GetClock();showimage();" ..........>

  • #8
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    The image swap script is keeping the clocks from showing.
    If you disable it the clocks show.

  • #9
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Yes I think I understand. But why does it work on the present Index page at

    www.exitfegs.co.uk

    effpeetee.

  • #10
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Thank you,
    But no matter where I put the onload; it does not work.

    Both of the j'scripts are in the one that works.
    What is different about this one?

    <!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" xml:lang="en">
    <head>
    <meta http-equiv="refresh" content="45" />
    <link rel="stylesheet" type="text/css" href="styles.css" />

    <title>index</title>
    <style type="text/css">
    h1,h2 {font-family: Arial;}
    h1,h2 {color:red}
    h6 {color:cyan}
    h6,h5,h4,h3,h2,h1 {
    margin: 0;
    }

    </style>

    [B]<script type="text/JAVASCRIPT" src="ind2clox.js">[/B]</script>
    <script type="text/javascript">

    function greet() {
    var todaydate = new Date();
    var timeis = todaydate.getTime();
    todaydate.setTime(timeis);
    var houris = todaydate.getHours();
    if (houris >17) display = "Evening";
    else if (houris >11) display = "Afternoon";
    else display = "Morning";
    var title = document.title;
    var welcome = ("Good " + display + ". Welcome to the Taylor Website");
    document.write(welcome);
    }

    </script>
    </head>

    <body>
    <div id="wrap">

    <span id="clockbox0"></span><span id="clockbox1"></span><br />
    <span id="greet"></span>

    <center>
    <h2>
    <script type="text/javascript">

    greet();

    </script></h2>

    </center><br />
    <br />
    <br />
    Some pictures are hyperlinks.<br />
    They move on to a new picture.<br />
    Click them and see!
    <div style= "Z-INDEX: 101; LEFT: 94px; WIDTH: 800px; POSITION: absolute; TOP: 49px; HEIGHT: 25px">
    <center>
    <script type="text/JAVASCRIPT" src=
    "indmain.js"></script>
    </center>
    </div><br />
    <br />
    Just a bit of family fun.<br />
    Don't take it too seriously.<br />
    Enjoy.
    <br />
    <br />
    <div style= "Z-INDEX: 101; LEFT: 252px; WIDTH: 770px; POSITION: absolute; TOP: 690px; HEIGHT: 21px">
    <center>
    The picture is randomly selected and will change every 45 seconds.&nbsp; Pressing the F5 key will also change it.<br />
    Clicking the screen picture will enlarge it and keep it on screen until you choose to move on.</center></div>

    <a href="two.html">Betty and Frank.</a><br />
    <a href="three.html">Little Ted and Dmitri.</a><br />
    <a href="four.html">Lovely Betty and Pussycat.</a><br />
    <a href="five.html">Betty and the Bears.</a><br />
    <a href="seven.html">Steven and Joyce and Mark.</a><br />
    <a href="twelve.html">Ritcroft family group.</a><br />
    <a href="Eddie.html">Eddie, relaxing at home.</a><br />
    <a href="Bluebell1.html">Steven at ease.</a><br />
    <a href="Steveintrain.html">Steve on the "Bluebell Line".</a><br />
    <a href="steveviewing.html">Steve at the box.</a><br />
    <a href="dadatpub.html">'Smile please'</a><br />
    <a href="Barker.html">Claire,Yvonne and Susan.</a><br />
    <a href="xmas2006.html">Christmas 2006 at Yvonne's.</a><br />
    <a href="nine.html">Family photos.</a><br />
    <a href="hol1.html">Holiday snaps.</a><br />
    <a href="LittleBoyBlue.html">Little Boy Blue</a><br />
    <a href="Tarantella.html">Do you remember an inn.</a><br />
    <h6>(One of Betty's favourite poems.)</h6>
    <a href="openpage.html">openpage.html</a>
    <br />
    <a href="Picchoose.html"><span class="t14ac">Picture Menu.</span></a>
    <br />
    <a href="Latest.html">Recently Added Picture(s).</a><br />
    <a href="aaind.html">Random pictures - full screen.</a><br /><br />

    Website Builder - Frank Taylor<br />
    Assisted by Claire Barker.<br />
    Checked with Internet Explorer 7.<br />
    <span class="t14w">Set to:- 1024 x 768 pixels.</span><br />
    <a href= "http://www.mmaus.com/Bestaddress.html"></a>BetterAddress HTML editor<br />
    Updated 8th May,2007
    </div>
    </body>

    </html>

    effpeetee.
    Last edited by effpeetee; 05-08-2007 at 05:43 PM.

  • #11
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    The reason the index page works is because the image swap script uses document.write to produce the image HTML,
    where as, in openpage.html the imageswap.js script uses DOM to create the image HTML and is called with a onload function.

    If you want to verify that the clock script can run on openpage, add the spans for the clockboxes like you have
    in your index page and stick a link calling the clock script
    Code:
    <span id="clockbox0"></span><span id="clockbox1"></span><br />
    <a href="javascript:GetClock()">Start Clock</a>
    As Arty stated, the two external scripts each use their own onload to start and thats causing your problem. Remove the onload functions in the external scripts and add the onload event handler to the body tag to call the scripts one after the other. I know you said you have tried it , but the page doesn't reflect it. It will continue to fail with the two onloads.

  • #12
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Thank you for your very clear explanation. I can now see the problem and I'll modify the code accordingly.
    I am now trying switch to using dynamic HTML and it is a bit of an up hill struggle. However, it is rewarding and I thank you all for your patience.

    I have only just realised that none of my pages except the index, have a doctype on them.
    That should keep me busy for a while.

    There are over two hundred of them.

    effpeetee.

  • #13
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts

    Exclamation

    RWEDGE

    I have tried the things that you suggest, but to no avail.
    You mention Documeny write as the reason that my index page works; but Document write is about the Greeting line "Good Morning - Welcome etc"

    The two things that apparently clash in openpage are both javascripts'

    I will quite understand if you think this thread has gone on long enough, but I would dearly like to know why the anomoly exists.

    effpeetee

    www.exitfegs.co.uk

    <title>Website/Page Title</title>
    <script type="text/javascript" src="ind2clox.js"></script>
    <script type="text/javascript" src="indmain.js"></script
    >
    function greet() {
    var todaydate = new Date();
    var timeis = todaydate.getTime();
    todaydate.setTime(timeis);
    var houris = todaydate.getHours();
    if (houris >17) display = "Evening";
    else if (houris >11) display = "Afternoon";
    else display = "Morning";
    var title = document.title;
    var welcome = ("Good " + display + ". Welcome to the Taylor Website");
    document.write(welcome);
    }
    </script>

  • #14
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,703
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Hey effpeetee,

    In the file(s) I attached in my post in the other thread I’ve rectified the JavaScript so the function calls aren’t overwriting themselves. Have you checked that out? You only need that one JS file and include the clockbox elements.

  • #15
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Hello VIPStephan

    Check out

    www.exitfegs.co.uk

    Look at bottom left credit.

    effpeetee

    Very grateful for all the help.


  •  

    Posting Permissions

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