JavaScript Function Using Multiple Instances /Locations?

Discussion in 'JavaScript' started by apollobc, Jun 17, 2008.

  1. #1
    Being somewhat, new to javascript coding, I am not sure why I am having the following issues?

    I have a javascript with several functions in it called 'ajax.js'.
    It is called in the body tag.
    <body onload="javascript:loadData();Fadewl();SLIDES.play();>
    Code (markup):
    In the 'ajax.js' the "loadData() function is:
     
    function loadData() {
      updateBanner();
      updatePlaying();
      updateHistory();
      updateOnline();
      updateListeners();
      displayTimeInt();
      updateTime();
      Fadewl();
    }
    
    Code (markup):
    The first problem I am having is that if a function in the 'ajax.js' script is not called, or unused, I get an "Error on page" message in the browse status bar?

    The second problem I am having is that I can only us the function output in one place, I can not call it from multiple locations? An example is the function that displays the time is:
    displayTimeInt()
    Code (markup):
    and the output is shown by:
    <span id="disTime">
    Code (markup):
    I can only have this 'SPAN' tag in one location, on one page only?

    The third problem I am having is that, for example, the time is displayed from a "header file" and displays in all pages fine that are in the root directory. There are a couple of pages that call the "header file" from sub-directories and in that case the:
    <span id="disTime">
    Code (markup):
    is empty and displays 'blank', the time is missing?

    Thanks for any help!
     
    apollobc, Jun 17, 2008 IP
  2. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    remove javascript: from the beginning
     
    MMJ, Jun 18, 2008 IP