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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:14:14+00:00 2026-05-30T10:14:14+00:00

I think I’m missing something here. in Script: $(‘#dialog:ui-dialog’).dialog(‘destroy’); $(‘#dialog-modal’).dialog({ width:150, height:150, resizable:false, draggable:false,

  • 0

I think I’m missing something here.

in Script:

$('#dialog:ui-dialog').dialog('destroy');
$('#dialog-modal').dialog({ width:150, height:150, resizable:false, draggable:false, autoOpen:true, modal:true });

I use AJAX to call for Data, when the pull detect an error, I want it to pop up an dialog.modal, but it just won’t do so. I think I’m missing something here.

in PHP:

case ($amt > $total_storage):
    echo "<div id='dialog-modal' class='ui-dialog-content ui-widget-content' title='Error!'><p>Not enough Storage!</p></div>";  (this one don't work)
    echo "Test Error";  (this one works)
    break;

I tested with echo and it does display “Error” but not the dialog.modal. I just want it to autoOpen when it detects an error.

New Workable Version:
PHP:

case ($amt > $total_storage):
    echo ":err:<p>Not enough Storage!</p></div>";
    break;

JS:

function CitySell(a){
    $.ajax({
        beforeSend: function(){ $(".Bags").attr("disabled", "disabled"); },
        url: "DataPull.php?get=CitySell&SSIDD="+$('.SDI_'+a).val()+"&SSAmD="+$('.STS_'+a).val(),
        success: function(data){
            $('#Listing').html(parseScript(data));
            if(data.substr(0,5) === ':err:'){
                $('<div id="dialog-modal" class="ui-dialog-content ui-widget-content" title="Error!">').html(data.substr(5)).dialog({width:250, height:150, resizable:false, draggable:false, autoOpen:true, modal:true});
                $('.Bags').removeAttr("disabled");
            } else {
                Listing();
                CommonUpdates();
            }
        }
    })
}
  • 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-30T10:14:16+00:00Added an answer on May 30, 2026 at 10:14 am

    Wrap you js code into a function

    function open_dialog(error_text)
    {
        $('#dialog:ui-dialog').dialog('destroy');
        $('#dialog-modal')
            .html(error_text)
            .dialog({ width:150, height:150, resizable:false, draggable:false, autoOpen:true, modal:true });
    }
    

    and make a function call at the onSuccess method

    $.get(url, function(result){ open_dialog(data); })

    Though you’ll have to distinguish between cases when the response indicates an error and when it’s not. You could add some characters to the response to see whether it’s an error or not:

    case ($amt > $total_storage):
    echo ":err:<p>Not enough Storage!</p></div>";  
    break;
    

    $.get(url, function(result){ if(data.substr(0,5) === ':err:') open_dialog(data); else alert(data); })

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

Sidebar

Related Questions

I think I'm missing something basic here. Any explanation or pointers to previously asked
I think I'm missing something basic here. Why is the third IF condition true?
I think I got all the steps down but I must be missing something
I think most people here understand the importance of fully automated builds. The problem
Think I'm missing a basic concept. I want to generate html by traversing through
I think that I am misunderstanding something about how jquery $(this) works. In my
Think about the following: Your ISP offers you a dynamic ip-address (for example 123.123.123.123).
Think: tiling my emacs window with eshells, a la xmonad. Is this possible? I
I think the file that is produced is an .asm file, any idea how
I think most people know how to do this via the GUI (right click

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.