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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:43:07+00:00 2026-05-23T13:43:07+00:00

I have a quite inconvenient problem. Say that I have the following functions function

  • 0

I have a quite inconvenient problem.

Say that I have the following functions

function name(namearg){
...
..
}

function handlefailed(){
..
..
}
function handlecover(){
..
..
}

Now to my problem, I have alot of hard coded html that can’t be changed that is calling both functions like this

<a href="javascript:handlecover();javascript:name('MSS')">Link</a>
<a href="javascript:handlefailed();javascript:name('GPS')">Link</a>
<a href="javascript:handlefailed();javascript:name('NPS')">Link</a>

The problem is the order of which I’m calling the functions, I first want to see which function that is called, either handlefailed() or handlecover(), and then want to know what name that is sent to the name function.

If I would have called the functions in the other way around I would just have done

var theName;

function name(namearg){
  theName = namearg
}

function handlefailed(){
callOtherfunctionInAnotherJavascript(getElements(theName + ".failed"));
}
function handlecover(){
callOtherfunctionInAnotherJavascript(getElements(theName + ".cover"));
}

But now this is not possible since I’m calling the name function after the first function.
Is there a way in javascript that “changes” the order of how the functions are evaluated, or do you guys have a clever sollution to my problem, I.E getting the value of the namearg variable and use it in the handlefailed() & handlecover() functions?

  • 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-23T13:43:07+00:00Added an answer on May 23, 2026 at 1:43 pm
    var postFix;
    function name(namearg){
        callOtherfunctionInAnotherJavascript(getElements(namearg + postFix));    
    }
    function handlefailed(){ postFix = '.failed'; }      
    function handlecover(){ postFix = '.cover'; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have quite a fundamental problem that none of my selenium phpunit tests pass
I have quite a few RewriteRules in my .htaccess that looks like this RewriteRule
I have quite a problem concerning the use of relational database concepts in Delphi
I have quite big document in html format that generated from Microsoft Word. It
Let's say we have the following input: <amy> (bob) <carol) (dean> We also have
We have quite a few validation methods that need to access repositories / database
I have quite a big table (about 4M of entries) for emails that are
I have quite a tricky problem: I am using a ListView control with the
I have quite a problem with finding out how to distribute the web based
Please suppose I have a function that accepts a pointer as a parameter. This

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.