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 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 few RewriteRules in my .htaccess that looks like this RewriteRule
I have quite a few cells that link to other worksheets/books, etc with standard
I have (after quite a bit of work) a web test that will upload
I have a quite common problem, as I saw in the various user groups
We currently have a quite complex business application that contains a huge lot of
Let's say we have the following input: <amy> (bob) <carol) (dean> We also have
The following code demonstrates a weird problem I have in a Turbo C++ Explorer
I have a problem with my autoloader: public function loadClass($className) { $file = str_replace(array('_',
Please suppose I have a function that accepts a pointer as a parameter. This
I have quite a large and complex table in a MySQL database that would

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.