Not able to overwrite old value in Drupal.settings I am facing Problems in overwriting old value in Drupal.setting.

Problem Statement

I am passing FID value from PHP to JS. At first it is getting correct value in JS. 

Ex. When PHP is passing FID=59 to JS for first time then it is correctly received by JS.
Next time when it is passing FID=60 then it is showing FID=59 in JS always.
Drupal.setting is not refreshing with current value.

My sample php code is like this

 function TraverseSnap($nextFID)
 {
    $thm_slideshowimg .= '&lt;input type="image" src="nxt.jpg" class="clsNextSnap" width="25" height="25"&gt;';

    $nxtSnapSetting = array(                
            'fid' =&gt; $nextFID,      
     );

    drupal_add_js(array('nxtSnp' =&gt; $nxtSnapSetting), 'setting');
 }


JS Code

(function($) {
 Drupal.behaviors.VidsImgsContent=
 {
      attach: function (context, settings)
      {
          var fileId = Drupal.settings.nxtSnp.fid;
          var dataNextSnap = 'fid=' +fileId;
          $.ajax({
                  url: 'nextsnap',
                  type: 'POST',
                  async : false,                  
                  dataType : 'json',                 
                  data : dataNextSnap,                  
                  success : updateMainNextDiv,
                  error : function(jqXHR, textStatus, errorThrown){alert("Some Error occured");},
                  beforeSend: function()
                  {                        
                  },
               });
               return false;
       }
  }
  })(jQuery);


My hook_menu call 

$items['nextsnap']=array(
   'title'=&gt;t(''),
   'type'=&gt; MENU_CALLBACK,        
   'page callback' =&gt; 'nxt_snap_post',       
   'access arguments' =&gt; array('access content'),
);


Page Callback

function nxt_snap_post()
{               
    $fid=$_POST['fid'];        

    $htmlResult = TraverseSnaps(60); //An arbitary Value for sake of this example
    drupal_json_output($htmlResult);
    exit();
}


So I believe when the button is clicked next time it will take FID=60 in JS but it is taking old value instead. 

Please help here as my crucial logic depends on this.
I think you can not do it this way. Data Drupal.settings only run in first load. This data store in tag head of page.



When you call ajax your function was execute, but tag head don't reaload. So Data.settings don't change.