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

The Archive Base Latest Questions

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

i wrote a function that takes a string as input. function ajaxLoad(targetBox, loadUrl) {

  • 0

i wrote a function that takes a string as input.

function ajaxLoad(targetBox, loadUrl) {
   $("div." + targetBox).css("opacity",0.25);
}

so normally i call this function like this.
ajaxLoad("commentListBox", "some url");

However right now, i have the problem that I need to pass a object i retrieve via a parent selector. so this is not a string but an object.

var box = $(this).parent().parent().toString();
ajaxLoad(box, "some url"); // is a syntax error

How can I handle this?

if i console.log(box);it says [OBJECT]

  • 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-23T17:51:08+00:00Added an answer on May 23, 2026 at 5:51 pm

    If you’re using class, try:

    var box = $(this).parent().parent()[0].className;
    ajaxLoad(box, "some url");
    

    If Id, try:

    function ajaxLoad(targetBox, loadUrl) {
       $("div#" + targetBox).css("opacity",0.25);
    }
    
    var box = $(this).parent().parent()[0].id;
    ajaxLoad(box, "some url");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this Array i wrote a function MostFreq that takes an array of
I am trying to write a function that as input takes a string containing
How can I write a function in Haskell, that takes an input string in
I wrote a function in haskell that takes a few parameters like Word32, String
I need to write a function that takes 4 bytes as input, performs a
I wrote this function that's supposed to do StringPadRight("Hello", 10, "0") -> "Hello00000" .
How do I write a function in C++ that takes a string s and
I should write an app that takes string input and computes the hash value
I want to write a function that takes an array of letters as an
I want to write 'twice' function that takes a function and an argument and

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.