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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:35:51+00:00 2026-05-27T04:35:51+00:00

I’ve been trying to work out how to pass additional parameters to a javascript

  • 0

I’ve been trying to work out how to pass additional parameters to a javascript callback function.

In similar posts users have succeeded using anonymous function (these are new to me so I may have been doing them wrong) but I just can’t get them to fire.

The below is what I have now, I need to be able to pass the itemId to the function “ajaxCheck_Callback” as well as the response.

Hope this makes sense.

Thanks for the help.

function delete(itemId)
{
  selectpage.ajaxCheck(itemId, ajaxCheck_Callback);
}


Function ajaxCheck_Callback(response)

{
  alert(response);
  alert(itemId);
}

Thanks for the help guys. I now get undefined on my alert whereas previously this was alerting correctly.

function delete(itemId)
{
  selectpage.ajaxCheck(itemid, function () {ajaxCheck_Callback(itemid); });
}


function ajaxCheck_Callback(response)

{
  alert(response);
  alert(itemId);
}
  • 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-27T04:35:52+00:00Added an answer on May 27, 2026 at 4:35 am

    The way is usually done is to use an anonymous function.

    function deleteItem(itemId) {
        selectpage.ajaxCheck(itemId, function() { ajaxcheck_Callback(itemId); });
    }
    
    function ajaxCheck_Callback(response)
    {
        alert(response);
    }
    

    Careful with your syntax, there are some errors in there. The function keyword has a lower-case f and you can’t have a function named delete, that’s a reserved keyword.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has

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.