0

I'm using jquery 1.10.3 to render a reasonably complex dialog. By 'complex', I mean that the contents of the dialog incorporate database-driven data, e.g. drop-down lists containing the result of database queries, as well as some static html (the server-side code is PHP). The dialog is modal, and is only shown when the user clicks on a button within the same page.

Given that the code in question has been produced for a paying client, I'm unable to post it lest I breach the terms and conditions of my contract.

The DIV containing the dialog content lies within the body of an HTML page, as per the JQuery demo:

http://jqueryui.com/dialog/

The problem (as minor as it is) is that the dialog contents are clearly visible (albeit very briefly, i.e. for a number of microseconds) when the page is loading. I am assuming that this is due to the fact that the dialog is rendered first before being hidden by JQuery.

I have tried a number of PHP output buffering configurations, but these appeared to have no impact on the issue. The only possible solution that I can think of, which would require the modification of code considered to be "outside the scope of the current body of work" by my client, is to load the contents of the dialog via a URL when the user clicks on the aforementioned button.

My client is unhappy with this and, accordingly, I must respond professionally. If anyone can point me in the direction of a fix, a workaround or an explanation as to why either of the aforementioned is not possible, it would be greatly appreciated.

  • 1
    Without seeing any code there's little we can do for you. Is there no way for you to sanitize the code so we can see an example of it without violating the T&C? – j08691 Oct 12 '13 at 13:15
  • EvanT no-one is interested about discussions between you and your client. Please provide the codes so we can help you. –  Oct 12 '13 at 13:29
  • j08691, I don't believe that the code will help in this instance.The dialog is built synchronously (i.e. all of the the data is assembled prior to the building of the dialog in php). Personally, I think that this is an unavoidable situation that is purely related to the size/complexity of the dialog in question,combined with the fact that the dialog is simply hidden by JQuery after being rendered. Loading the dialog contents via URL alters the user experience and resolves the immediate issue. However, this effectively results in an additional HTTP GET which has to function via a reverse-proxy. –  Oct 12 '13 at 14:21
  • And let's be frank: to actually notice the issue in the first place you would have to be very particular (some might say "anal") to begin with. I think I am butting my head against a technological limit, and the work-around requires the modification of code that should arguably have been modified a long time ago, in a galaxy far, far away. –  Oct 12 '13 at 14:27
  • And just in case anyone cares/asks, this behaviour occurs in IE, Firefox, Chrome and Safari. This behaviour is, IMHO, totally dictated by the mechanism via which in-page dialogs are rendered and then hidden. –  Oct 12 '13 at 14:57
  • possible duplicate of [JQuery dialog momentairly displayed on page load](http://stackoverflow.com/questions/2604309/jquery-dialog-momentairly-displayed-on-page-load) – André Dion Nov 06 '13 at 14:15

1 Answers1

0

I had the same problem and the answer posted in the below link seems to help, please have a look:

JQuery dialog momentairly displayed on page load

Basically the dialog will be hidden by CSS before the document is loaded. Hope this helps.

Community
  • 1
  • 1
finrod
  • 521
  • 8
  • 21