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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:46:21+00:00 2026-06-15T15:46:21+00:00

Basically if have this that works. It opens a query dialog box $(#opener).click(function() {

  • 0

Basically if have this that works. It opens a query dialog box

$("#opener").click(function() {
    $.ajax({
        url: "hello.php",
        success: function(data) {
            $("#dialog").html(data).dialog("open");
        }
    });

    $("#dialog").dialog({
        bgiframe: true,
        autoOpen: false,
        height: 400,
        width: 400,
        modal: true
    });
});​

I want to call it from a

onClick="callMyFuncion(withDetails);

and basically send an ajax get request with myDetails.. heres what I’m trying

function getDayDetails(details) {
    $.ajax({
        type: "GET",
        data: details,
        url: "hello.php",
        success: function(data) {
            $("#dialog").html(data).dialog("open");
        }
    });

    $("#dialog").dialog({
        bgiframe: true,
        autoOpen: false,
        height: 400,
        width: 400,
        modal: true
    });
};​

and calling it from here

<td class="everyday" onClick="getDayDetails(monthID=<?php echo $month; ?>&dayID=<?php echo $day_num; ?>&yearID=<?php echo $year; ?>);">

I’m new to Javascript/ Jquery.. Thanks for any help

  • 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-06-15T15:46:22+00:00Added an answer on June 15, 2026 at 3:46 pm

    I believe you opted to use inline JavaScript since there was no way at hand for you to make it dynamic.

    An alternative could be to use data-* attributes to hold the date values. As shown below:

    <td class="everyday"
        data-month="<?php echo $month; ?>"
        data-day="<?php echo $day_num; ?>"
        data-year="<?php echo $year; ?>">
      ...
    </td>
    

    And keep using the .click() function instead of inlining JavaScript [as told] which should be better avoided.

    $("td.selector").click(function() {
      var data = $(this).data();
      $.ajax({
        type: "GET",
        url: "hello.php",
        data: { monthID: data.month, dayID: data.day, yearID: data.year },
        success: function(data) {
          $("#dialog").html(data).dialog("open");
        }
      });
    });​
    

    Passing data to $.ajax as an object has the advantage that jQuery will automatically encode the parameters.

    Finally, you can move the .dialog() initialization to a .ready() function.

    $(document).ready(function() {
      $("#dialog").dialog({
        bgiframe: true,
        autoOpen: false,
        height: 400,
        width: 400,
        modal: true
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this error that is keeping me from moving forward. I basically have
Basically, I have this webpage that is the header on any page you go
I have this horribly stripped delphi code that basically login to server, save cookie
I have this small piece of code that basically takes a list and runs
I have this type which is basically a struct { int x,y,z; } that
So i have been creating this framework thing that basically puts together source code
I have a View that is basically setup like this: <Grid> <ViewBox> <Grid> <ItemsControl
I have a button that basically looks like this: <Button android:id=@+id/admin_new_questions android:layout_width=fill_parent android:layout_height=wrap_content android:text=See
I have a simple script that does some search and replace. This is basically
I have a Sinatra app that, boiled down, looks basically like this: class MyApp

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.