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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:26:08+00:00 2026-05-25T02:26:08+00:00

I finished my Javascript code and its about 3,000 lines long. There are many

  • 0

I finished my Javascript code and its about 3,000 lines long. There are many variables within the code(60+), but a few of the variables I’d like to write to my page such as

totalTime
longitudinalAcceleration
shiftTime
numberOfShifts
corneringTime
numberOfCorners
instantaneousCoefficientOfFriction
totalFuel
meanLongAccel
meanHorsepower

These are all variables within the Jscript code(not included because it would be too long). What I’d like to be able to do is to write this code to my main HTML page which calls the function. THe javascript function is called images.js(dont ask lol). I’m pretty sure I need an output variable thats an object within the Jscript file. This part I’m not too sure about how to do, or how to later write parts of the object variable in the actual HTML page.

Basically I am running Main Calculation() which is contained within image.js, after this function is ran, I want to pull those variables and write them to my HTML page. Those are the variables you see above. How do I grab those variables after the calculation has been ran? I’m pretty sure I need to use jQuery or Javascript to write the variables to the page??

Here is a link to the page if it helps
http://www.fsaesim.com/Products.html

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript" src="images.js"></script>
    <script type="text/javascript">
        function ShowCalculation() {
            Main($("#vehicleWeightTxt").val(), $("#tireChoiceSel").val(), $("#wheelBaseTxt").val(), $("#wheelRadiusTxt").val(), $("#trackWidthTxt").val(), $("#hcgTxt").val(), $("#weightDistributionTxt").val(), $("#shiftRpmTxt").val(), $("#ntTxt").val());


        }
    </script>

</head>

<body id="page4">
    <div class="body1">
    <div class="body2">
    <div class="body5">
        <div class="main">

            <header>
                <div class="wrapper">
                <h1><a href="index.html" id="logo">Progress Business Company</a></h1>
                <nav>
                    <ul id="menu">
                        <li id="nav1" class="active"><a href="index.html">Home<span>Page</span></a></li>

                        <li id="nav2"><a href="News.html">News<span>Updates</span></a></li>

                        <li id="nav3"><a href="Services.html">Available<span>Features</span></a></li>

                        <li id="nav4"><a href="Products.html">Run<span>Simulation</span></a></li>

                        <li id="nav5"><a href="Contacts.html">Contact<span>Support</span></a></li>
                    </ul>
                </nav>
                </div>
            </header>

        </div>
    </div>
    </div>
    </div>
    <div class="body1">
        <div class="main">
        <br />
        <table border="0">
        <tr>
        <td>
        Tire Choice
        </td>
        <td>
        <select id="tireChoiceSel">
        <option value="1">Michelin 13"</option>
        <option value="2">Hoosier 13" Large</option>
        <option value="3">Hoosier 13" Small</option>
        <option value="4">Mexican Tires</option>
        </select>
        </td>
        <td>
        Engine:
        </td>
        <td><select id="engineSelectionSel">
        <option value="1">Yamaha R6 - 4 Cylinder</option>
        <option value="2">Yamaha WR450 - 1 Cylinder</option>
        <option value="3">Honda CBR600RR - 4 Cylinder </option>
        <option value="4">Suzuki GSXR600 - 4 Cylinder</option>
        </select>
        </td>
        <td>
        Torque Curve:
        </td>
        <td>
        <select id="torqueCurveSel">
        <option value="1">Cornell Curve 2008</option>
        <option value="2">MIT Curve 2008</option>
        <option value="3">RMIT Curve 2008 </option>
        <option value="4">Fullerton Curve 2008</option>
        </select>
        </td>
        </tr>

        <tr>
        <td>
        Vehicle Weight:
        </td>
        <td>
        <input type="text" id="vehicleWeightTxt" value="530" size="3" />
        </td>
        <td>
        Number of NOS:
        </td>
        <td>
        <input type="text" id="Text1" value="100" size="3" />
        </td>
        <td>
        NOS Bottle #1:
        </td>
        <td>
        <input type="text" id="Text2" value="3000" size="3" />
        </td>
        </tr>

        <tr>
        <td>
        Wheel Base:
        </td>
        <td>
        <input type="text" id="wheelBaseTxt" value="61" size="3" />
        </td>
        <td>
        NOS Bottle #2:
        </td>
        <td>
        <input type="text" id="Text3" value="3000" size="3" />
        </td>
        <td>
        NOS Bottle #3:
        </td>
        <td>
        <input type="text" id="Text4" value="3000" size="3" />
        </td>
        </tr>

        <tr>
        <td>
        Wheel Radius:
        </td>
        <td>
        <input type="text" id="wheelRadiusTxt" value="10.25" size="3"  />
        </td>
        <td>
        NOS Bottle #4:
        </td>
        <td>
        <input type="text" id="Text5" value="3000" size="3" />
        </td>
        <td>
        NOS Bottle #5:
        </td>
        <td>
        <input type="text" id="Text6" value="3000" size="3" />
        </td>
        </tr>

        <tr>
        <td>
        Track Width:
        </td>
        <td>
        <input type="text" id="trackWidthTxt" value="50" size="3" />
        </td>
        <td>
        NOS Bottle #6:
        </td>
        <td>
        <input type="text" id="Text7" value="3000" size="3" />
        </td>
        <td>
        NOS Bottle #7:
        </td>
        <td>
        <input type="text" id="Text8" value="3000" size="3" />
        </td>
        </tr>

        <tr>
        <td>
        Center of Gravity: 
        </td>
        <td>
        <input type="text" id="hcgTxt" value="12" size="3" />
        </td>
        <td>
        NOS Bottle #8:
        </td>
        <td>
        <input type="text" id="Text9" value="3000" size="3" />
        </td>
        <td>
        NOS Bottle #9:
        </td>
        <td>
        <input type="text" id="Text10" value="3000" size="3" />
        </td>
        </tr>

        <tr>
        <td>
        Weight Distribution: 
        </td>
        <td>
        <input type="text" id="weightDistributionTxt" value="0.50" size="3" />
        </td>
        <td>
        NOS Bottle #10:
        </td>
        <td>
        <input type="text" id="Text11" value="3000" size="3" />
        </td>
        <td>
        NOS Bottle #11:
        </td>
        <td>
        <input type="text" id="Text12" value="3000" size="3" />
        </td>
        </tr>

        <tr>
        <td>
        Shift RPM: 
        </td>
        <td>
        <input type="text" id="shiftRpmTxt" value="9500" size="3" />
        </td>
        <td>
        NOS Bottle #12:
        </td>
        <td>
        <input type="text" id="Text13" value="3000" size="3" />
        </td>
        <td>
        NOS Bottle #13:
        </td>
        <td>
        <input type="text" id="Text14" value="3000" size="3" />
        </td>
        </tr>

        <tr>
        <td>
        Final Drive Ratio: 
        </td>
        <td>
        <input type="text" id="ntTxt" value="2.86" size="3" />
        </td>
        <td>
        NOS Bottle #14:
        </td>
        <td>
        <input type="text" id="Text15" value="3000" size="3" />
        </td>
        <td>
        NOS Bottle #15:
        </td>
        <td>
        <input type="text" id="Text16" value="3000" size="3" />
        </td>
        </tr>


















        </table>



    <center><input type="submit" value="Calculate" onclick="ShowCalculation(); return false;" /></center>
        </div>
    </div>
    <div class="body4">
        <div class="main">
            <article id="content2">
                <div class="wrapper">
                    <section class="col3">
                        <h4>Why Us?</h4>
                        <ul class="list1">

                            <li><a href="#">Professional Engineers</a></li>

                            <li><a href="#">Years of Experience</a></li>

                            <li><a href="#">Vehicle Dynamics Experts</a></li>
                        </ul>
                    </section>
                    <section class="col3 pad_left2">
                        <h4>Address</h4>
                        <ul class="address">
                            <li><span>Location:</span>United States, CA</li>

                            <li><span>City:</span>Northridge</li>

                            <li><span>Phone:</span>1-888-888-8888</li>

                            <li><span>Email:</span><a href="mailto:fsaesimulation@gmail.com">Contact Us</a></li>
                        </ul>
                    </section>
                    <section class="col3 pad_left2">
                        <h4>Follow Us</h4>
                        <ul id="icons">
                            <li><a href="#"><img src="images/icon1.jpg" alt="">Facebook</a></li>
                            <li><a href="#"><img src="images/icon2.jpg" alt="">Twitter</a></li>

                        </ul>
                    </section>
                    <section class="col2 right">
                        <h4>Search The Site</h4>
                        <form id="newsletter" method="post">
                            <div>
                                <div class="wrapper">
                                    <input class="input" type="text" value="Type Your Email Here"  onblur="if(this.value=='') this.value='Type Your Email Here'" onFocus="if(this.value =='Type Your Email Here' ) this.value=''" />
                                </div>
                                <a href="#" class="button" onClick="document.getElementById('newsletter').submit()">Search</a>
                            </div>
                        </form>
                    </section>
                </div>
            </article>
<!-- content end -->
        </div>
    </div>
  • 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-25T02:26:09+00:00Added an answer on May 25, 2026 at 2:26 am

    if I get it right, you compute these values, they are a result you want to display,

    I would suggest to create a div where you want to show them (like, under the calculate button)(or a modal box, that would replace the alert).

    and in js, a bit basic but well:

    var stuffToShow = [
    'totalTime',
    'longitudinalAcceleration',
    'shiftTime',
    'numberOfShifts',
    'corneringTime',
    'numberOfCorners',
    'instantaneousCoefficientOfFriction',
    'totalFuel',
    'meanLongAccel',
    'meanHorsepower'
    ];
    
    var someHtml = '';
    $(stuffToShow).each( function () {
        someHtml += '<div id="'+this+'">'+this+': '+youResultObject[this]+</div>;
    });
    
    $('#yourResultDiv').html(someHtml).slidedown('slow');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that Javascript doesn't have multiple threads, but I'd like to know if
We all know that global variables are anything but best practice. But there are
There is a JavaScript function, of which I have zero control of the code,
In JavaScript, I have code like this: var sound = new Audio(name); sound.onended =
Just finished reading Crockford's JavaScript: The Good Parts and I have a question concerning
Is there anyway to automatically run javascript:window.print() when the page finishes loading?
Just finished read this post by Greg Young, where he is talking about Microsoft
I finished my website and uploaded it to my webhost, but i get this
Already finished implementing the player. I want to implement the progress bar. But I
I just finished a small project where changes were required to a pre-compiled, but

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.