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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:55:23+00:00 2026-05-26T06:55:23+00:00

I am attempting to take 2 variables, perform math on them and then output

  • 0

I am attempting to take 2 variables, perform math on them and then output them as a new 3rd variable. Here’s the basic logic I attempting to do:

var A1 = [+ditto_iteration+]
var B1 = [+gallery_currentPage+]
var C1 = (B1-1)*3+A1+1

Then I need to take the value of the variable C and output in some HTML like so:

<a href="variable C1 here">link</a>

So to clarify, I’ve got some programming that will output the value of [+ditto_iteration+] on page load. Same with [+gallery_currentPage+]. I just need to be able to take the variable values of A1 and B1, perform the math as shown above and then replace a variable in the URL (in this case C1) with the resulting value of the math operation.

  • 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-26T06:55:23+00:00Added an answer on May 26, 2026 at 6:55 am
    <script>
    var A1 = parseInt([+ditto_iteration+]);
    var B1 = parseInt([+gallery_currentPage+]);
    var C1 = (B1-1)*3+A1+1;
    
    $('#link').attr('href', C1);
    
    </script>
    
    
    <a id='link' href="variable C1 here">link</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am probably attempting to take URL Canonicalization a bit too far but here
I'm attempting to take 4-5 fields from a large django form and display them
I'm attempting to take values from a XML file and put them into a
I'm attempting to take a string value from a Combo box then pass it
I'm attempting to take large (huge) images (from a digital camera), and convert them
I'm attempting to take the different values in a list, add them up and
Me and a colleague are starting a new project and attempting to take full
I'm attempting to take Excel 2003 and connect it to SQL Server 2000 to
Basically Im attempting to take a php / jquery / css / html web
I'm attempting to take an NSImage and convert it to a string which 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.