javascript - Dojo "loading"-message -


I'm new to dojo, so I need some help.

Some of my links are awhile (when the user clicks, the page takes several seconds before loading), and I would like to add a "Loading" message.

I call it "old fashion way", but I want to learn new, easy, clever dojo-way.

Actually how it works is not important anymore, but I think something like this:

A rectangular browser-between windows (between documents Not in.) There is an animated GIF, and a message like "Please wait ...".

All other elements are disabled, maybe a little "fade out" may be that there is a large white 50% transparent rectangle, which sits between the "loading" -message and the rest of the document.

After the

What are you describing that Dojo already has the time that the model code Dijit.Dialog appears with the loading message.

Now, normally, the dojo is loaded once your page is fully loaded, it starts executing, and you normally pass as an anonymous function parameter Put your dojo code inside dojo.addOnLoad () .

This is the reason that emphasizes the need that the remaining part of your page (which you call your "link") must be loaded through AJAX (for example, dijit Layout.ContentPane ). Thus, Dojo can execute before downloading the content, and your "Waiting" message may appear first.

It may look like this:

  & lt; Html & gt; & Lt; Top & gt; & Lt; Link rel = "stylesheet" href = "/ dojo / dijit / themes / tundra / tundra.css" type = "text / css" media = "screen" /> & Lt; Script type = "text / javascript" src = "/ dojo / dojo.js" djConfig = "parseOnLoad: true" & gt; & Lt; / Script & gt; / * Make sure that you minimize your libraries and dojo to load faster ... * / & lt; Script type = "text / javascript" src = "/ dojo / yourOwnDojoCompressedScripts.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Var dialogue; Dojo.addOnLoad (function () {dojo.require ("dijit.layout.ContentPane"); dojo.require ("dijit.Dialog"); dialog = new dijit.Dialog (); dialog.setContent ("& lt; p & Gt; This page will be available in a tick! & Lt; / p & gt; "); dialog.show ();}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body class = "tundra" & gt; & Lt; Div id = "delayedContent" dojoType = "dijit.layout.ContentPane" href = "/ myContentUrl" onLoad = "dialog.hider ()" & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

The only drawback in that plan is the dojo: Expecting your shrinksafed (to 90K weight, possibly to 300K, depending on how much stuff you put in Is the library you are there) On a slow connection, it still takes a noticeable amount of time to download. He said, we are talking about an static 90K --- --- the same user will download it only once in each session, and even less if you have the right cache / expiry headers It will take time to set up when those static files are served.


Comments

  1. 1xbet korean | Sportsbet 1xbet korean | Legalbet
    1xbet korean. The sportsbook is powered by sportsbook Bet1xbet, 1xbet korean which offers many options, in-game kadangpintar and online worrione sportsbook.

    ReplyDelete

Post a Comment