$.getJSON Problem

Started on the old forum in August 2011 · view the original in the archive · old links redirect here

5 replies · 495 views · started 15 years ago · 1 min read

2 participants
subzero Super moderator Fellow · 3,954 posts #2

You will need to make a template Html or this will never works !!

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

StRiNg_MaStEr Developer · 93 posts #3

subzero wrote: You will need to make a template Html or this will never works !!

JSON doesnt reqieure templete

i used this bt nt workin

           $(document).ready(function() {
                $.getJSON('http://djfire.in/tt/dj.php', function(data) {
                        $.each(data, function(i,item){ 
                                $('body').append('<strong>' + item.name+ '</strong>');
                                $('body').append('<br/><span style="font-size: 85%">albumID:' + item.id+ '</span>');
                                $('body').append('<p>' + item.time+ '</p><br/>');
                        });
                });
            }); 
        </script>
</head>
<body>
</body>
subzero Super moderator Fellow · 3,954 posts #4

Here is simple json script

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="copy.xsl"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title>SoF server status</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="SoF server status from sof1.megalag.org" />

<link href="server-status-def.css" rel="stylesheet" type="text/css" title="SoF default" />
<link href="server-status-alt.css" rel="alternate stylesheet" type="text/css" title="SoF alternate" />

</head>

<body id="cssonclick">

<table>
  <tr><td class="strong">Hostname</td><td id="hostname">-</td></tr>
  <tr><td class="strong">Address</td><td><span id="ip">-</span>:<span id="hostport">-</span> <a id="mhpss" href="mhpss://-:-" title="Connect with SoF-Starter (http://mhp-clan.de/sofstarter/)">*</a></td></tr>
  <tr><td class="strong">Gametype</td><td id="deathmatch">-</td></tr>
  <tr><td class="strong">Map</td><td id="mapname">-</td></tr>
</table>

<p></p>

<table id="player_table" class="tsmall">
<tr>
  <td class="strong">Slot</td>
  <td class="strong">Name</td>
  <td class="strong">Score</td>
  <td class="strong">Ping</td>
  <td class="strong">FPS</td>
  <td class="strong">PPM</td>
  <td class="strong">FRG</td>
  <td class="strong">DIE</td>
  <td class="strong">SK</td>
  <td id="hdrtk" class="strong">TK</td>
  <td id="hdrflg" class="strong">FLG</td>
  <td class="strong">GUID</td>
</tr>

<tr id="row0">
  <td id="slot0">0</td>
  <td id="name0">-</td>
  <td id="score0">-</td>
  <td id="ping0">-</td>
  <td id="fps0">-</td>
  <td id="ppm0">-</td>
  <td id="frg0">-</td>
  <td id="die0">-</td>
  <td id="sk0">-</td>
  <td id="tk0">-</td>
  <td id="flg0">-</td>
  <td id="guid0">-</td>
</tr>
<tr id="row1">
  <td id="slot1">1</td>
  <td id="name1">-</td>
  <td id="score1">-</td>
  <td id="ping1">-</td>
  <td id="fps1">-</td>
  <td id="ppm1">-</td>
  <td id="frg1">-</td>
  <td id="die1">-</td>
  <td id="sk1">-</td>
  <td id="tk1">-</td>
  <td id="flg1">-</td>
  <td id="guid1">-</td>
</tr>
<tr id="row2">
  <td id="slot2">2</td>
  <td id="name2">-</td>
  <td id="score2">-</td>
  <td id="ping2">-</td>
  <td id="fps2">-</td>
  <td id="ppm2">-</td>
  <td id="frg2">-</td>
  <td id="die2">-</td>
  <td id="sk2">-</td>
  <td id="tk2">-</td>
  <td id="flg2">-</td>
  <td id="guid2">-</td>
</tr>
<tr id="row3">
  <td id="slot3">3</td>
  <td id="name3">-</td>
  <td id="score3">-</td>
  <td id="ping3">-</td>
  <td id="fps3">-</td>
  <td id="ppm3">-</td>
  <td id="frg3">-</td>
  <td id="die3">-</td>
  <td id="sk3">-</td>
  <td id="tk3">-</td>
  <td id="flg3">-</td>
  <td id="guid3">-</td>
</tr>
<tr id="row4">
  <td id="slot4">4</td>
  <td id="name4">-</td>
  <td id="score4">-</td>
  <td id="ping4">-</td>
  <td id="fps4">-</td>
  <td id="ppm4">-</td>
  <td id="frg4">-</td>
  <td id="die4">-</td>
  <td id="sk4">-</td>
  <td id="tk4">-</td>
  <td id="flg4">-</td>
  <td id="guid4">-</td>
</tr>
<tr id="row5">
  <td id="slot5">5</td>
  <td id="name5">-</td>
  <td id="score5">-</td>
  <td id="ping5">-</td>
  <td id="fps5">-</td>
  <td id="ppm5">-</td>
  <td id="frg5">-</td>
  <td id="die5">-</td>
  <td id="sk5">-</td>
  <td id="tk5">-</td>
  <td id="flg5">-</td>
  <td id="guid5">-</td>
</tr>
<tr id="row6">
  <td id="slot6">6</td>
  <td id="name6">-</td>
  <td id="score6">-</td>
  <td id="ping6">-</td>
  <td id="fps6">-</td>
  <td id="ppm6">-</td>
  <td id="frg6">-</td>
  <td id="die6">-</td>
  <td id="sk6">-</td>
  <td id="tk6">-</td>
  <td id="flg6">-</td>
  <td id="guid6">-</td>
</tr>
<tr id="row7">
  <td id="slot7">7</td>
  <td id="name7">-</td>
  <td id="score7">-</td>
  <td id="ping7">-</td>
  <td id="fps7">-</td>
  <td id="ppm7">-</td>
  <td id="frg7">-</td>
  <td id="die7">-</td>
  <td id="sk7">-</td>
  <td id="tk7">-</td>
  <td id="flg7">-</td>
  <td id="guid7">-</td>
</tr>
<tr id="row8">
  <td id="slot8">8</td>
  <td id="name8">-</td>
  <td id="score8">-</td>
  <td id="ping8">-</td>
  <td id="fps8">-</td>
  <td id="ppm8">-</td>
  <td id="frg8">-</td>
  <td id="die8">-</td>
  <td id="sk8">-</td>
  <td id="tk8">-</td>
  <td id="flg8">-</td>
  <td id="guid8">-</td>
</tr>
<tr id="row9">
  <td id="slot9">9</td>
  <td id="name9">-</td>
  <td id="score9">-</td>
  <td id="ping9">-</td>
  <td id="fps9">-</td>
  <td id="ppm9">-</td>
  <td id="frg9">-</td>
  <td id="die9">-</td>
  <td id="sk9">-</td>
  <td id="tk9">-</td>
  <td id="flg9">-</td>
  <td id="guid9">-</td>
</tr>
<tr id="row10">
  <td id="slot10">10</td>
  <td id="name10">-</td>
  <td id="score10">-</td>
  <td id="ping10">-</td>
  <td id="fps10">-</td>
  <td id="ppm10">-</td>
  <td id="frg10">-</td>
  <td id="die10">-</td>
  <td id="sk10">-</td>
  <td id="tk10">-</td>
  <td id="flg10">-</td>
  <td id="guid10">-</td>
</tr>
<tr id="row11">
  <td id="slot11">11</td>
  <td id="name11">-</td>
  <td id="score11">-</td>
  <td id="ping11">-</td>
  <td id="fps11">-</td>
  <td id="ppm11">-</td>
  <td id="frg11">-</td>
  <td id="die11">-</td>
  <td id="sk11">-</td>
  <td id="tk11">-</td>
  <td id="flg11">-</td>
  <td id="guid11">-</td>
</tr>
<tr id="row12">
  <td id="slot12">12</td>
  <td id="name12">-</td>
  <td id="score12">-</td>
  <td id="ping12">-</td>
  <td id="fps12">-</td>
  <td id="ppm12">-</td>
  <td id="frg12">-</td>
  <td id="die12">-</td>
  <td id="sk12">-</td>
  <td id="tk12">-</td>
  <td id="flg12">-</td>
  <td id="guid12">-</td>
</tr>
<tr id="row13">
  <td id="slot13">13</td>
  <td id="name13">-</td>
  <td id="score13">-</td>
  <td id="ping13">-</td>
  <td id="fps13">-</td>
  <td id="ppm13">-</td>
  <td id="frg13">-</td>
  <td id="die13">-</td>
  <td id="sk13">-</td>
  <td id="tk13">-</td>
  <td id="flg13">-</td>
  <td id="guid13">-</td>
</tr>
<tr id="row14">
  <td id="slot14">14</td>
  <td id="name14">-</td>
  <td id="score14">-</td>
  <td id="ping14">-</td>
  <td id="fps14">-</td>
  <td id="ppm14">-</td>
  <td id="frg14">-</td>
  <td id="die14">-</td>
  <td id="sk14">-</td>
  <td id="tk14">-</td>
  <td id="flg14">-</td>
  <td id="guid14">-</td>
</tr>
<tr id="row15">
  <td id="slot15">15</td>
  <td id="name15">-</td>
  <td id="score15">-</td>
  <td id="ping15">-</td>
  <td id="fps15">-</td>
  <td id="ppm15">-</td>
  <td id="frg15">-</td>
  <td id="die15">-</td>
  <td id="sk15">-</td>
  <td id="tk15">-</td>
  <td id="flg15">-</td>
  <td id="guid15">-</td>
</tr>
<tr id="row16">
  <td id="slot16">16</td>
  <td id="name16">-</td>
  <td id="score16">-</td>
  <td id="ping16">-</td>
  <td id="fps16">-</td>
  <td id="ppm16">-</td>
  <td id="frg16">-</td>
  <td id="die16">-</td>
  <td id="sk16">-</td>
  <td id="tk16">-</td>
  <td id="flg16">-</td>
  <td id="guid16">-</td>
</tr>
<tr id="row17">
  <td id="slot17">17</td>
  <td id="name17">-</td>
  <td id="score17">-</td>
  <td id="ping17">-</td>
  <td id="fps17">-</td>
  <td id="ppm17">-</td>
  <td id="frg17">-</td>
  <td id="die17">-</td>
  <td id="sk17">-</td>
  <td id="tk17">-</td>
  <td id="flg17">-</td>
  <td id="guid17">-</td>
</tr>
<tr id="row18">
  <td id="slot18">18</td>
  <td id="name18">-</td>
  <td id="score18">-</td>
  <td id="ping18">-</td>
  <td id="fps18">-</td>
  <td id="ppm18">-</td>
  <td id="frg18">-</td>
  <td id="die18">-</td>
  <td id="sk18">-</td>
  <td id="tk18">-</td>
  <td id="flg18">-</td>
  <td id="guid18">-</td>
</tr>
<tr id="row19">
  <td id="slot19">19</td>
  <td id="name19">-</td>
  <td id="score19">-</td>
  <td id="ping19">-</td>
  <td id="fps19">-</td>
  <td id="ppm19">-</td>
  <td id="frg19">-</td>
  <td id="die19">-</td>
  <td id="sk19">-</td>
  <td id="tk19">-</td>
  <td id="flg19">-</td>
  <td id="guid19">-</td>
</tr>
<tr id="row20">
  <td id="slot20">20</td>
  <td id="name20">-</td>
  <td id="score20">-</td>
  <td id="ping20">-</td>
  <td id="fps20">-</td>
  <td id="ppm20">-</td>
  <td id="frg20">-</td>
  <td id="die20">-</td>
  <td id="sk20">-</td>
  <td id="tk20">-</td>
  <td id="flg20">-</td>
  <td id="guid20">-</td>
</tr>
<tr id="row21">
  <td id="slot21">21</td>
  <td id="name21">-</td>
  <td id="score21">-</td>
  <td id="ping21">-</td>
  <td id="fps21">-</td>
  <td id="ppm21">-</td>
  <td id="frg21">-</td>
  <td id="die21">-</td>
  <td id="sk21">-</td>
  <td id="tk21">-</td>
  <td id="flg21">-</td>
  <td id="guid21">-</td>
</tr>
<tr id="row22">
  <td id="slot22">22</td>
  <td id="name22">-</td>
  <td id="score22">-</td>
  <td id="ping22">-</td>
  <td id="fps22">-</td>
  <td id="ppm22">-</td>
  <td id="frg22">-</td>
  <td id="die22">-</td>
  <td id="sk22">-</td>
  <td id="tk22">-</td>
  <td id="flg22">-</td>
  <td id="guid22">-</td>
</tr>
<tr id="row23">
  <td id="slot23">23</td>
  <td id="name23">-</td>
  <td id="score23">-</td>
  <td id="ping23">-</td>
  <td id="fps23">-</td>
  <td id="ppm23">-</td>
  <td id="frg23">-</td>
  <td id="die23">-</td>
  <td id="sk23">-</td>
  <td id="tk23">-</td>
  <td id="flg23">-</td>
  <td id="guid23">-</td>
</tr>
<tr id="row24">
  <td id="slot24">24</td>
  <td id="name24">-</td>
  <td id="score24">-</td>
  <td id="ping24">-</td>
  <td id="fps24">-</td>
  <td id="ppm24">-</td>
  <td id="frg24">-</td>
  <td id="die24">-</td>
  <td id="sk24">-</td>
  <td id="tk24">-</td>
  <td id="flg24">-</td>
  <td id="guid24">-</td>
</tr>
<tr id="row25">
  <td id="slot25">25</td>
  <td id="name25">-</td>
  <td id="score25">-</td>
  <td id="ping25">-</td>
  <td id="fps25">-</td>
  <td id="ppm25">-</td>
  <td id="frg25">-</td>
  <td id="die25">-</td>
  <td id="sk25">-</td>
  <td id="tk25">-</td>
  <td id="flg25">-</td>
  <td id="guid25">-</td>
</tr>
<tr id="row26">
  <td id="slot26">26</td>
  <td id="name26">-</td>
  <td id="score26">-</td>
  <td id="ping26">-</td>
  <td id="fps26">-</td>
  <td id="ppm26">-</td>
  <td id="frg26">-</td>
  <td id="die26">-</td>
  <td id="sk26">-</td>
  <td id="tk26">-</td>
  <td id="flg26">-</td>
  <td id="guid26">-</td>
</tr>
<tr id="row27">
  <td id="slot27">27</td>
  <td id="name27">-</td>
  <td id="score27">-</td>
  <td id="ping27">-</td>
  <td id="fps27">-</td>
  <td id="ppm27">-</td>
  <td id="frg27">-</td>
  <td id="die27">-</td>
  <td id="sk27">-</td>
  <td id="tk27">-</td>
  <td id="flg27">-</td>
  <td id="guid27">-</td>
</tr>
<tr id="row28">
  <td id="slot28">28</td>
  <td id="name28">-</td>
  <td id="score28">-</td>
  <td id="ping28">-</td>
  <td id="fps28">-</td>
  <td id="ppm28">-</td>
  <td id="frg28">-</td>
  <td id="die28">-</td>
  <td id="sk28">-</td>
  <td id="tk28">-</td>
  <td id="flg28">-</td>
  <td id="guid28">-</td>
</tr>
<tr id="row29">
  <td id="slot29">29</td>
  <td id="name29">-</td>
  <td id="score29">-</td>
  <td id="ping29">-</td>
  <td id="fps29">-</td>
  <td id="ppm29">-</td>
  <td id="frg29">-</td>
  <td id="die29">-</td>
  <td id="sk29">-</td>
  <td id="tk29">-</td>
  <td id="flg29">-</td>
  <td id="guid29">-</td>
</tr>
<tr id="row30">
  <td id="slot30">30</td>
  <td id="name30">-</td>
  <td id="score30">-</td>
  <td id="ping30">-</td>
  <td id="fps30">-</td>
  <td id="ppm30">-</td>
  <td id="frg30">-</td>
  <td id="die30">-</td>
  <td id="sk30">-</td>
  <td id="tk30">-</td>
  <td id="flg30">-</td>
  <td id="guid30">-</td>
</tr>
<tr id="row31">
  <td id="slot31">31</td>
  <td id="name31">-</td>
  <td id="score31">-</td>
  <td id="ping31">-</td>
  <td id="fps31">-</td>
  <td id="ppm31">-</td>
  <td id="frg31">-</td>
  <td id="die31">-</td>
  <td id="sk31">-</td>
  <td id="tk31">-</td>
  <td id="flg31">-</td>
  <td id="guid31">-</td>
</tr>

</table>

<p></p>

<table>
<tr>
  <td>
  <table class="tsmall">
    <tr><td class="strong">WAX mode</td><td id="sp_sv_wax_mode">-</td></tr>
    <tr><td class="strong">Players</td><td><span id="players">-</span>/<span id="maxclients">-</span></td></tr>
    <tr><td class="strong">Time limit</td><td id="timelimit">-</td></tr>
    <tr><td class="strong">Frag limit</td><td id="fraglimit">-</td></tr>
    <tr id="rowctf1"><td class="strong">CTF flags</td><td><span id="flags_red" class="color2">-</span> / <span id="flags_blue" class="color5">-</span></td></tr>
    <tr id="rowctf2"><td class="strong">CTF loops</td><td id="ctf_loops">-</td></tr>
    <tr><td class="strong">Movescale</td><td id="g_movescale">-</td></tr>
    <tr><td class="strong">Suicide</td><td id="sv_suicidepenalty">-</td></tr>
    <tr><td class="strong" valign="top">Flags</td>
        <td>
          <span id="flag_0">-<br /></span>
          <span id="flag_1">No health<br /></span>
          <span id="flag_2">No items<br /></span>
          <span id="flag_4">Weapons stay<br /></span>
          <span id="flag_8">No falling damage<br /></span>
          <span id="flag_16">Realistic damage<br /></span>
          <span id="flag_32">Same level<br /></span>
          <span id="flag_64">No weapon reload<br /></span>
          <span id="flag_128">Teamplay<br /></span>
          <span id="flag_256">No friendly fire<br /></span>
          <span id="flag_512">Force respawn<br /></span>
          <span id="flag_1024">No armor<br /></span>
          <span id="flag_2048">Infinite ammo<br /></span>
          <span id="flag_4096">Spinning weapons<br /></span>
          <span id="flag_8192">Bullet only<br /></span>
          <span id="flag_16384">Force join<br /></span>
          <span id="flag_32768">Team red blue<br /></span>
        </td></tr>
  </table>
  </td>
  <td id="screenshot" valign="top">
     
  </td>
</tr>
</table>

<script type="text/javascript" src="server-status.js"></script>

<script type="text/javascript" src="server-status-css.js"></script>

<script type="text/javascript">
<!--
obj_server_status.func_init( "obj_server_status", "" );
//obj_server_status.func_init( "obj_server_status", "82.94.226.186:28950" );
// -->
</script>

</body>

</html>
// Rotate through stylesheets

var obj_server_status_css =
{
  "func_next_stylesheet": function()
  {
    var arr_element = document.getElementsByTagName( "link" );
    var i_style_pos = 0;
    var i_style_count = 0;
    for ( var i_count = 0; i_count < arr_element.length; i_count++ )
    {
      if ( arr_element[i_count].getAttribute( "rel" ).indexOf( "style" ) != -1 )
      {
        i_style_count++;
        if ( arr_element[i_count].disabled == false )
        {
          arr_element[i_count].disabled = true;
          i_style_pos = i_style_count;
        }
      }
    }

    if ( i_style_count > 0 )
    {
      if ( i_style_pos == i_style_count )
      {
        i_style_pos = 0;
      }

      i_style_count = 0;
      for ( var i_count = 0; i_count < arr_element.length; i_count++ )
      {
        if ( arr_element[i_count].getAttribute( "rel" ).indexOf( "style" ) != -1 )
        {
          if ( i_style_pos == i_style_count )
          {
            arr_element[i_count].disabled = false;
            break;
          }
          i_style_count++;
        }
      }
    }
  }

}

document.getElementById( "cssonclick" ).onclick = obj_server_status_css.func_next_stylesheet;
"result": -1, "version": 1, "ip": "0.0.0.0", "hostport": 0, "screenshot": 0, "_sp_sv_version": "", "flags_blue": 0, "flags_red": 0, "_sp_sv_wax_mode": 0, "control_bonus": 0, "control_limit": 0, "ctf_loops": 0, "deathmatch": 0, "dmflags": 0, "fraglimit": 0, "g_movescale": 0.00, "hostname": "", "mapname": "", "maxclients": 0, "maxspectators": 0, "sv_suicidepenalty": 0, "sv_violence": 0, "timelimit": 0.0, "players": 0, 

Yes All this to run json server status i thought it didn't need it lmao

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

StRiNg_MaStEr Developer · 93 posts #5

subzero

its nt solution only JQuery is enough to do it

and php is used to generate JSON nt to retrieve

subzero Super moderator Fellow · 3,954 posts #6

Yeah but some times you mite learn from others when i coding a site that needed a template to just to see the status

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close