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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:50:27+00:00 2026-05-15T08:50:27+00:00

yet again thanks for looking. i like to call a function (eg. comment_disp, post_disp

  • 0

yet again thanks for looking.

i like to call a function (eg. comment_disp, post_disp or any other i create later on).

i have created a json function with url, fname and id can i use fname as a function name?

// on document ready runs
json('comments.php','comment_disp');
  • url = url to get
  • fname = function
  • name id = post or any other data id.
json = function(url,fname,id){
$.getJSON(url,(fname));
}

comment_disp = function(json){
}
  • 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-15T08:50:28+00:00Added an answer on May 15, 2026 at 8:50 am

    Functions are first-class objects in JavaScript. You can put them into parameters directly, no need to transport their name as string.

    So instead of

    json = function(url,fname,id){ $.getJSON(url,(fname)); }
    

    do

    json = function(url,f,id){ $.getJSON(url, f); }
    

    and call it as

    json('comments.php', comment_disp);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm going to rebuild my Linux box [yet] again. I have to create a
If I have a subclass that has yet to implement a function provided by
Yet again, my teacher was unable to answer my question. I knew who may
Anybody found yet a good web site architecture using linq to sql? Any help
Since Rails is not multithreaded (yet), it seems like a threaded web framework would
I'm looking for a good PHP login class via MySQL, and I'm not yet
I have a question concerning functions with jQuery. I have a function that once
Let presume we have something like this: <div1> <h1>text1</h1> <h1>text2</h1> </div1> <div2> <h1>text3</h1> </div2>
Better yet, how can I make My Computer always open in Explorer as well?
I run Jetty6 yet gladly place Apache in the front if needs be. 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.