www.webdeveloper.com
Results 1 to 2 of 2

Thread: Why doesn't this work ?

Hybrid View

  1. #1
    Join Date
    Oct 2012
    Posts
    7

    Why doesn't this work ?

    Hello fellow Javascript developers

    I am trying to get a div to to load with a file in the same folder. Here is the code:
    Code:
    <HTML>
    <HEAD>
    <TITLE>
    Div Experiment
    </TITLE>
    <script language="javascript" type="text/javascript" src="jquery.js">
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script>
    function headsMessage()
    {
    alert("cat");
    
    $("#tony").load("PrincipalsMessage .html");
    
    alert("dog");
    
    }
    </script>
    </HEAD>
    <BODY>
    
    <button align="center" onclick="headsMessage()">Click to get Scott's message</button>
    <br>
    
    <div id = "tony">
    </div>
    </BODY>
    </HTML>
    Both alerts work but the file does not load. http://www.webdeveloper.com/forum/im...s/confused.gif
    Any ideas ?
    Rory Barrett
    Last edited by jedaisoul; 03-20-2014 at 05:59 PM. Reason: code tags added

  2. #2
    Join Date
    Mar 2014
    Posts
    40
    You have a space between "PrincipalsMessage" and ".html"

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