Hi, I have 10 titles and 10 descriptions of the products for the online shop in products.txt
titles are in title class
descriptions are in descriptions class
How can I put them like this in my div
<div class='content'>
<title1>
<description1>
<title2>
<descirpiton2>
and so on.....
</div>
I've tried to wrote some script in jQuery, but I'm only couple of days familiar with it, and I can't do it myself for now
<script>
$('.content').load(''products.txt .titles // but how can I mix them ?
I don't know, maybe I should better use .ajax method ?
thank you very much
Can you help me with jQuery ?
Moderator: General Moderators
-
jankidudel
- Forum Commoner
- Posts: 91
- Joined: Sat Oct 16, 2010 4:30 pm
- Location: Lithuania, Vilnius
Re: Can you help me with jQuery ?
The .ajax() method is more powerful & necessary if you plan to do any parsing of the content returned by your AJAX call. How is products.txt structured? You'll likely need to do some parsing of the text you get back, then loop through it, creating the DOM elements in each loop and inserting those new elements into the page.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.