Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:39:31+00:00 2026-05-26T08:39:31+00:00

i have this JS: $.getJSON(‘getMessageDetails.php’, function (json) { var uc = json[4]; var uc_length

  • 0

i have this JS:

$.getJSON('getMessageDetails.php', function (json) { 
   var uc = json[4];
   var uc_length = uc.length;
   var firstPartLength = uc_length - 5;
   var uc_1 = uc.substring(0, firstPartLength);  
   var uc_2 = uc.substr(-5, 3);
   var uc_3 = 'RC';
   if (json[2] != old_id)
   {
      $("#td_id").text(json[2]);
      $("#td_id_new").text(json[2]);
      $("#td_subject").text(json[3]);
      $("#span_1").text(uc_1); 
      $("#span_2").text(uc_2); 
      $("#span_3").text(uc_3); 
      old_id = json[2];
   }    
 }); 

then i have my php/html

 if (count($row) > 0)
 {
    echo "<input type='hidden' id='td_id_new' value='".$new_id."'></input>";   
    echo  $new_id;
    echo "<tr>";        
    echo '<td><a class="red_link" href="'.ADDRESS.'view_message.php?id='.$new_id.'"><span class="red_link" id="td_subject">'.$subject.'</span></a></td>';
    echo '<td><span id="span_1">'.$uniqueCode1.'</span><span id="span_2" class="pink_text">'.$uniqueCode2.'</span><span id="span_3">'.$uniqueCode3.'</span></td>';
    echo "</tr>";
  }

all i want is to set $new_id via my json $(“#td_id_new”).text(json[2]);

when i inspect element the output there gives $new_id as 0….as i initialized it and not with the new id everything else(all other tags) updates fine with my json

inspect element:

 <input xmlns="http://www.w3.org/1999/xhtml" type="hidden" id="td_id_new" value="0">7</input>

i got the value property of the above to be 7 thus $new_id is 7 BUT STILL nothing in the a tag for $new_id???

some help please?
thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:39:32+00:00Added an answer on May 26, 2026 at 8:39 am

    you set new_id=0 in your PHP.

    If you take that out and have initialized the JSON like you said, it should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have this code: $.getJSON('../encomendasanexos.php?campo=idencomendas&nome=imagem&id='+id_int, function(registro){ var imghtml = []; imghtml = '<img src=icones/editar.png
I currently have this: $.getJSON('test.json', function(data) { var items = []; $.each(data, function(key, val)
i have this code: $.getJSON('newMessageDetails', function (json) { var old_id = document.getElementById(td_id).value; var messages_count
I have this code: var myRSS =[]; function rssReader() { $.getJSON('bbc.php', function(data){ console.log(data); $.each(data[0].channel.item,
I have this code: $.getJSON(Featured/getEvents, function(data){ $.each(data.events, function(i,event){ var title = event.title.substr(0,20); $(#title-+i).text(Text); if
Let's say I have this script: $('.myDiv').click(function(){ $.getJSON('http://example.com/t.php', { department: 'department', manufacturer: '' }
I have this piece of code: $.getJSON('http://domai.nr/api/json/search?q='+encodeURI(d.val())+'&callback=?','',function(data){...}); But I'm seeing this in my Google
I'm a total loss. I have this function to read the Twitter Json. The
i have something like this: $(#btn).click(function (event) { $.getJSON(url, function (data) { // i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.