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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:41:01+00:00 2026-05-22T15:41:01+00:00

I have a live function that triggers the ‘openwindow’ function and I need to

  • 0

I have a live function that triggers the ‘openwindow’ function and I need to also be able to call that ‘openwindow’ function seperately, hence my ‘initial function call’. The problem is, the id #open-window featured in my live call is the id I want to be able to apply $(this) to (in the openwindow function). If anyone has any suggestions on how to make this possible, I would appreciate it.

function openwindow(user, token) {
if(user==''){
    var user = $(this).attr('data-name');
    var token = $('#token').attr('data-value');
}
//append some information

}

//event triggered on click
$('#open-window').live('click', openwindow);

//initial function call
openwindow('hey','hey');
  • 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-22T15:41:02+00:00Added an answer on May 22, 2026 at 3:41 pm

    Not sure of the exact functionality you want. But here is an attempt to modify what you had to use the event object that jQuery provides. You can use this object to store your own data (as I show) and get the original dom object.

    Some documentation here.
    http://api.jquery.com/category/events/event-object/

    function openwindow(event) {
       inUser = event.data.user;
       inToken = event.data.token;
    
       if(inUser=='default'){
          var user = $(event.target).attr('data-name');
          var token = $('#token').attr('data-value');
       }
    //append some information
    }
    
    //event triggered on click
    $('#open-window').live('click', { user : 'default', token : 'default' }, openwindow);
    
    //initial function call
    openwindow({ data : { user : 'hey', token :'hey' },
                 target : '#somelocation that has a data-name' });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a live MySQL database that is 99% INSERTs, around 100 per second.
I have a live search on my help page that searches our help database
I have a test web service replicating a live web service that hasn't been
I have a program that captures live data from a piece of hardware on
I have a backup server that automatically backs up my live site, both files
I have created a PHP-script to update a web server that is live inside
I have this piece of code // TR Fading when deleted $('.delete').live('click', function() {
Does anyone have a PHP function that for example if a mysql_error() happens due
I have an application which has to live as a service, I create an
I have a project where I am taking some particularly ugly live HTML 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.