- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I have a product page on my website. There are two div’s on the page like product list on the left and its description on the right. When one of the hyperlink in the product list is clicked its description must come on the right div. How can i make this possible with ajax. Please help me.
Hope this helps: https://gist.github.com/alenabdula/9954542
Make sure you are running local server if you’re trying to test this file, due to Cross-Site privacy settings.
But I want to get the html when it is clicked on the same page in another div. Please help me.
But I want to get the html when it is clicked on the same page in another div. Please help me.
That is what the above code does. It takes whatever pages are linked and loads them in the <div class="view"></div>
<ul class="menu">
<li><a href="product-one.html">Product One</a></li>
<li><a href="product-two.html">Product Two</a></li>
<li><a href="product-tri.html">Product Tri</a></li>
</ul>
When you click on the first link product-one.html
that HTML document is loaded. Just create the document product-one.html
and place the product description. The JavaScript takes whatever is in the href
and loads that page via AJAX.
I’ve commented the Gist I’ve linked to earlier, that might help.
-Alen