Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>EDIT (see bottom for updated on loading just one kid data at a time)</p> <p>An example on how you could achieve that:</p> <pre><code>&lt;style type='text/css' media='screen'&gt; button { margin-left:20px; display:inline; } &lt;/style&gt; &lt;script type='text/javascript' src='jquery-1.7.1.min.js'&gt;&lt;/script&gt; &lt;script type='text/javascript'&gt; function loadKidData(kidID) { switch (kidID) { case 1 : $('#kName').text(' John Doe'); $('#kNickname').text(' Speedy'); $('#kHobbies').text(' Booling'); break; case 2 : $('#kName').text(' Mathews Doe'); $('#kNickname').text(' Slowy'); $('#kHobbies').text(' Basketball, baseball'); break; case 3 : $('#kName').text(' Jackson Doe'); $('#kNickname').text(' J-DOE'); $('#kHobbies').text(' Archery'); break; case n : $('#kName').text(' Enne Doe'); $('#kNickname').text(' The-Nanny'); $('#kHobbies').text(' Anything goes'); break; default : $('#kName').text(''); $('#kNickname').text(''); $('#kHobbies').text(''); } } jQuery( function () { $('.nav').click( function () { loadKidData($(this).html().replace('KID ','')*1.0); // *1.0 same as parseInt(...,10). }) }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;button class='nav' &gt;KID 1&lt;/button&gt;&lt;button class='nav' &gt;KID 2&lt;/button&gt;&lt;button class='nav' &gt;KID 3&lt;/button&gt; &lt;div id='KID_INFO' style='margin:20px auto; overflow:auto; ' &gt; &lt;p&gt;Name:&lt;span id='kName'&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;Nickname:&lt;span id='kNickname'&gt;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;Hobbies:&lt;span id='kHobbies'&gt;&lt;/span&gt; &lt;/p&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>Sample at: <a href="http://zequinha-bsb.int-domains.com/kidsinfo.html" rel="nofollow">http://zequinha-bsb.int-domains.com/kidsinfo.html</a></p> <p>Now, as far as dynamically displaying the data, it will have to do with your resources: database? If so, you could read the data and pass it over:</p> <pre><code>$.get('url-of-the-database-reading-script',function (data) { // assumed all data comes back formatted: $('#KIDS_INFO').html(data); }); </code></pre> <p>I can/could help you further, more details would help. Are you using classic asp (.asp); php; etc?</p> <p>EDIT:</p> <p>Instead of this:</p> <pre><code>jQuery( function () { $('.nav').click( function () { loadKidData($(this).html().replace('KID ','')*1.0); // *1.0 same as parseInt(...,10) }) }); </code></pre> <p>Do this:</p> <pre><code>jQuery( function () { $('.nav').click( function () { $.get('your-data-fetching-url?kidID='+$(this).html().replace('KID ','')*1.0, function (data) { //assumed the data comes back formatted: $('#KIDS_DATA').html(data); }) }) }); </code></pre> <p>Note that I put a question mark at the end of the url; followed by the querystring kidID=</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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