Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax calls within the changing Div
    primarykey
    data
    text
    <p>i am working on my first Ajax Project and i cannot find a solution for this problem:</p> <p>This is my Ajax Code:</p> <pre><code>$(document).ready(function(){ var seite = $('div.ipadSeite'); $('a').on('click', function(e){ var href = $(this).attr('href'); seite.load( href ); e.preventDefault(); }); </code></pre> <p>});</p> <p>And this is the index.php:</p> <pre><code>....&lt;div id="ipadHeader"&gt; &lt;nav&gt; &lt;ul&gt; &lt;li&gt;100% |=|&lt;/li&gt; &lt;li&gt; &lt;?php echo date("h:i a"); ?&gt; &lt;/li&gt; &lt;li&gt;TWT&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/div&gt; &lt;div class="ipadSeite"&gt; &lt;img src="../images/homescreen.png" id="homescreenImage" /&gt; &lt;a href="seiten/1app.php"&gt;&lt;div id="appIcon"&gt;&lt;p&gt;TWT&lt;/p&gt;&lt;/div&gt;&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;.... </code></pre> <p>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":</p> <pre><code> &lt;img src="../images/homescreen.png" id="homescreenImage" /&gt; &lt;a href="informationen.php"&gt;&lt;div id="appIcon"&gt;&lt;p&gt;TWT&lt;/p&gt;&lt;/div&gt;&lt;/a&gt; </code></pre> <p>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. </p> <p>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. </p> <p>Thank you very much! Kevin</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload