www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Page Refreshing Problem

  1. #1
    Join Date
    Apr 2010
    Posts
    5

    resolved [RESOLVED] Page Refreshing Problem

    Hi,
    I am a newbie to Ajax so I'm sorry if I am misunderstanding what it can do. My understanding of it is that it can access server side documents from the client side without refreshing. With that being said my problem is here:

    http://24.63.116.135/testarea

    Its not close to being done yet but the idea of the page is when the user clicks on one of the links its supposed to fade out the rest of the page and show information that is echoed from a php file.
    They are simple files now, all thats there is:

    PHP Code:
    <?php
        
    echo 'clubs'/* this is 'bars' for bars.php and so on */
    ?>
    It works beautifully except it seems to be refreshing the page after this happens. I know this because I had put an alert in the javascript to tell me which page it was going to load. It came up twice, the first time it was right but the second time it said it was loading clubs.php. The reason its doing this is because its told to in the onload part of the body tag. If I get rid of this it doesn't shows neither the page fading nor text in the div (I looked at the source).

    Any help is greatly appreciated. Again sorry if I am misunderstanding what ajax can do. Let me know if you need any more explanation or if there is a better way to do this.

  2. #2
    Join Date
    Apr 2010
    Posts
    5
    Solved:

    My links were like this:
    HTML Code:
    <ul>
    <a href="" onclick="Javascript: popupMenu('in'); getAjax('clubs');">Clubs</a>
    They should have been like this:
    HTML Code:
    <a href="Javascript: popupMenu('in'); getAjax('clubs');">Clubs</a>
    I'm still not sure why it was refreshing but it works and I'll be sure not to make that mistake again

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