Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to start with AJAX/JSON in Zend?
    text
    copied!<p>I am working on some projects as a developer(PHP,MySQL) in which AJAX and jQuery is already implemented. But now I want to learn implementation of AJAX and jQuery stuff. Can anyone tell me the exact steps with explanation?</p> <p>I have created a project in Zend. There is only one controller(IndexController) and two actions(a and b) in my project now. Now I want to use ajax in my project. But I don't know how to start. I read some tutorial but unable to completely understand.</p> <p>I have index.phtml like this:</p> <pre><code>&lt;a href='index/a'&gt;Load info A&lt;/a&gt; &lt;br/&gt; &lt;a href='index/b'&gt;Load info B&lt;/a&gt; &lt;br /&gt; &lt;div id=one&gt;load first here&lt;div&gt; &lt;div id=two&gt;load second here&lt;/div&gt; </code></pre> <p>Here index is controller in links. a and b are actions.</p> <p>now I have four files like this:</p> <p>a1.phtml</p> <pre><code>I am a1 </code></pre> <p>a2.phtml</p> <pre><code>I am a2 </code></pre> <p>b1.phtml</p> <pre><code>I am b1 </code></pre> <p>b2.phtml</p> <pre><code>I am b2 </code></pre> <p>I think you have got my point. </p> <p>When user clicks first link <strong>(Load info A)</strong> then <strong>a1.phtml</strong> should be loaded into <strong>div one</strong> and <strong>a2.phtml</strong> should be loaded into <strong>div two</strong></p> <p>When user clicks second link <strong>(Load info B)</strong> then <strong>b1.phtml</strong> should be loaded into <strong>div one</strong> and <strong>b2.phtml</strong> should be loaded into <strong>div two</strong></p> <p>Will someone help me? Thanks</p>
 

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