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

  • SEARCH
  • Home
  • 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 7989989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:53:19+00:00 2026-06-04T12:53:19+00:00

I’ve made a javascript to make a list of values for a list box.

  • 0

I’ve made a javascript to make a list of values for a list box. The values comes from database in SQL Server. when I make some change with the values on database, the values on my list box don’t update. It seems that the browser caches the value or something, because when I clear the cache on my browser, the values in the list box update.

here is my javascript (authapp.js):

$(document).ready(function(){
  $(window).load(function(){                           
    var loads = '<table>'+
                '<tr>'+
                '<td align="center" class="label">'+
                '<img src="../../../Images/loading.gif" alt="Please wait..."
                  align="middle" style="width:30px;height:30px;">'+
                '</td>'+
                '</tr>'+
                '<tr>'+
                '<td align="center" class="label">'+
                '<font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Loading...</font>'+
                '</td>'+
                '</tr>'+
                '</table>';

    //load selected customer
    $.ajax({
        type: "GET",
        url: "master/authtpl/queries/get_sel_cust.asp",
        data: "cunit="+$('#cunit').val()+"&ccduser="+$('#ccduser').val(),
        beforeSend: function(){
                $('#load_sel').block({ 
                message: loads, 
                css: { border: 'none',
                       top: '10%',
                       width: '10%',
                       backgroundColor: '#606060', 
                       opacity: '0.3'
                      } 
                });
             },
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(response) {
          $('#load_sel').unblock();
          if(response==undefined){
              alert('List q of Selected Customer is not available!');
          } else {
              $('#selSelected').empty();
              var cust = (typeof response.cust) == 'string' ? eval('(' + response.cust + ')') : response.cust;
              // get data from json
              var count = 0,strs = '';
              lent = cust.length;
                do {
                  strs += '<option value="'+cust[count].ckode+'|'+cust[count].cgrup+'|'+cust[count].cnama+'">'+cust[count].ckode+' - '+cust[count].cnama;
                  count++;
                } while (count < lent);
                $('#selSelected').append(strs);
          }
        }
      });   
    });
});

and here is my query to get that value (get_sel_cust.asp):

<!-- #INCLUDE file = "../../../include/createconnection.asp" -->

<%
    dwdb = Application("DWDB")


    ccdappl = Application("CCDAPPL")
    ckdunitkey = trim(Request.QueryString("cunit"))
    ccduser = trim(Request.QueryString("ccduser"))

    sql = "select distinct ckdrelasi,ckdgruprelasi,vnamarelasi  "&_
          "from " & dwdb & ".dwaustasia.dbo.ms_webuser_apprtpl "&_
          "where ckdunitkey='"&ckdunitkey&"' and ccduser='"&ccduser&"' and ccdappl='"&ccdappl&"' "&_
          "order by ckdrelasi"
    objCommand.commandText = sql
    'response.write sql
    set aloc = objCommand.execute
    if NOT aloc.BOF then
        aloc.moveFirst
        json = "{ ""cust"" : [ "
        body_json = ""
        temp = ""
        WHILE NOT aloc.EOF
            temp =  "{"&_
                            """ckode"":"""&aloc("ckdrelasi")&""","&_
                            """cgrup"":"""&aloc("ckdgruprelasi")&""","&_                            
                            """cnama"":"""&aloc("vnamarelasi")&""""&_
                    "},"
            body_json = body_json&temp
            aloc.moveNext
        WEND
        body_json = mid(body_json,1,len(body_json)-1)
        json2 = "   ] } "   
        hasil = json&body_json&json2
        response.write hasil
    end if  

    set objCommand = nothing
    response.end
%>

and this is the list box form (default.asp):

<SELECT name="selSelected" id="selSelected" MULTIPLE SIZE="10" class="label" style="width:250px;">

                    </SELECT>

I don’t know where is the problem comes from. Can you tell me did I make some mistake on my coding? thanks 🙂

  • 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-06-04T12:53:20+00:00Added an answer on June 4, 2026 at 12:53 pm

    Try disabling the AJAX caching in jQuery:

    $.ajaxSetup ({
        // Disable caching of AJAX responses
        cache: false
    });
    

    There are loads of places caching can happen – but it’ll be easier to start with the client and work backwards.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am currently running into a problem where an element is coming back from
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

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.