Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8108943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:15:58+00:00 2026-06-06T01:15:58+00:00

i am working on my first Ajax Project and i cannot find a solution

  • 0

i am working on my first Ajax Project and i cannot find a solution for this problem:

This is my Ajax Code:

$(document).ready(function(){

var seite = $('div.ipadSeite');

$('a').on('click', function(e){
    var href = $(this).attr('href');

    seite.load( href );
    e.preventDefault(); 
});

});

And this is the index.php:

....<div id="ipadHeader">
        <nav>
            <ul>
                <li>100% |=|</li>
                <li>
                    <?php 
                        echo date("h:i a");
                    ?> 
                </li>
                <li>TWT</li>
            </ul>
        </nav>
    </div>
    <div class="ipadSeite">
        <img src="../images/homescreen.png" id="homescreenImage" />
        <a href="seiten/1app.php"><div id="appIcon"><p>TWT</p></div></a>
    </div>
</div>....

When first starting the Application the Link: a href=”seiten/1app.php is working! So I created an Home Button to go Back to the index.php. This is the File wich is loaded trough Ajax to go back “home”:

    <img src="../images/homescreen.png" id="homescreenImage" />
<a href="informationen.php"><div id="appIcon"><p>TWT</p></div></a>

It simply loads the same content in “ipadSeite”.
My first Question: This is wrong right? It should be easier? But when linking to index.php it loads the whole site (header, footer ..) and the functionality breaks.

Second Question: My Solution works, but when i click on the button another time, it dont makes an Ajax Request. Instead it opens a regular link but without CSS. I really cannot find any solution for that. I hope you guys understand my problem and my explanation.

Thank you very much!
Kevin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:15:59+00:00Added an answer on June 6, 2026 at 1:15 am

    Delegate function:

    $(document).delegate('a','click',function(){//Write your function here})
    

    ‘On’ I find very situational. ‘Delegate’ and ‘live’ both work well with asynchronously load elements.

    Robert

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the first time I am working for a front-end project that requires
this is my very first question. I'm working on a fully Ajax system with
this is actually my first ZK project seems pretty cool but not working and
Working on my first Rails project, I used Ryan Bates' Nifty-Generators to create the
I working on my first ASP.net MVC project and and i got some problems
I'm working on a first symfony project, i am using the sfWidgetFormTextareaTinyMCE widget for
I'm working on my first Core Data project (on iPhone) and am really liking
I'm working on my first PHP project, and it's going well. I've been able
I'm working on my first major Cocoa app for an undergraduate research project. The
I'm doing my first Ruby on Rails project. I am working on a project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.