Note that there are some explanatory texts on larger screens.

plurals
  1. POReading JSON arrays with jQuery/JS
    primarykey
    data
    text
    <p>Alright, this pretty much goes along with my previous question. I'm still trying to figure out how to display data from an array which is created by a PHP file- using JS/jQuery. I'm working on a points system for ZetaBoards, and I've currently got it set up <a href="http://s1.zetaboards.com/RyJoe/index/" rel="nofollow noreferrer">here</a>. (Points will be displayed below the users post count once I get this working.. you guys can't see the +/- functions which work fine, haha. :p )</p> <p><a href="http://outlinetokens.hostei.com/scripts/output.php" rel="nofollow noreferrer">http://outlinetokens.hostei.com/scripts/output.php</a></p> <p>So, for each user- I can get their user ID, I just don't know how to check if their name is in the array. (and if it is, display their points) I'm guessing I'll have to do something like this? Here's the chunk of the code that deals with this.. you'll see where I need help.</p> <pre><code>if (location.href.match('/topic/')) { $.getScript('http://outlinetokens.hostei.com/scripts/output.php', function () { $('td.c_username a.member').each(function () { value = 0; u = $(this).attr('href').split('profile/')[1].split('/')[0]; // this is where I need to do the 'search.' Just a basic guess.. help. D: if (values.uid == u) { value = values.points; } $(this).parents('tr').next().find('dl.user_info').append('&lt;dt&gt;' + options.system_name + ':&lt;/dt&gt;&lt;dd class="Points"&gt;&lt;span id="point_total"&gt;' + value + '&lt;/span&gt;&lt;/dd&gt;'); }); }) } </code></pre> <p>...in case the code tag screwed it up:</p> <p><a href="http://ryjoe.pastebin.com/raw.php?i=0bsZNnVq" rel="nofollow noreferrer">http://ryjoe.pastebin.com/raw.php?i=0bsZNnVq</a>`</p> <p>Thanks! (:</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.
 

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