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 8148507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:39:34+00:00 2026-06-06T14:39:34+00:00

I have a two JavaScript files: Main.js Pmt.js I’m also using thick box (Ajax

  • 0

I have a two JavaScript files:

  1. Main.js
  2. Pmt.js

I’m also using thick box (Ajax call)

in Main.js

$(document).ready(function() {

 var cnt=0;

$("#btnPmt").click(function(){
    cnt=cnt+1;
    tb_show('Void Transaction','pmt.jsp?height=310&width=400', null);
});


});

The Pmt.js file is included in pmt.jsp as

<script src="js/Pmt.js" type="text/javascript"></script>

in Pmt.js

 $("#btnPmtClose").click(function(){
    cnt=0;
    parent.tb_remove();
});

How we can reset the value of var cnt in Pmt.js that decalred in Main.js?
The above is not working, when I close the thickbox, I find the incremented value, not zero that set on close, even Ajax call.

  • 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-06T14:39:35+00:00Added an answer on June 6, 2026 at 2:39 pm

    in Main.js make cnt as global var by moving it outside any function :

    var cnt=0;
    $(document).ready(function() {
        ...
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this javascript in substitution of remote_action: $(document).ready(function() { $('#asset_category_id').change(function() { $.ajax({ url
I have created two JavaScript files. One file is "validators.js" and the other is
I have two javascript files in one folder.I want to pass a variable one
Here's the deal - I have two files, main.html and processing.php. Within the php
I would like to have two separated Javascript files. One for IE and another
I have two types of JavaScript files. One contains static code and the other
I have two files. location.php, that outputs this: [[javascript],[PHP]] and in another file: <script
I've seen JavaScript files formatted two different ways and I have no idea what
Here I am trying to implement the jQuery I have two main files one
I have an HTML file which imports two files: graph.js and main.js The main

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.