Method for displaying “loading” message

Tags: json ajax jquery

I am using jquery and the getJSON method and I am wondering if there is a way to display a message saying loading before it loads my content. i know with the jquery ajax calls there is the before submit callbacks where you can have something but the getJSON only has like three options.

Any ideas?

By : Coughlin



Something like that would work, just display a simpling div element with the display text Loading... then display my JSON results.


By : Coughlin

Add this somewhere to your page:

<div id="loading" style="display:none">
    <img src="/images/ajax-loader.gif" alt="Loader" />&nbsp;Loading...
<script type="text/javascript">
    $().ready(function() {
        $("#loading").bind("ajaxSend", function() {
        }).bind("ajaxComplete", function() {

You can style the loader-div as you like, e.g Google Mail-like loader:

   top: 0;
   padding:2px 5px;
   z-index: 5000;
By : liggett78

It sounds like you need to use some indirection, via the a grammar rule reference. This can be done with the GrammarBuilder.AppendRuleReference method. It might be easier to test out your grammars first with some SRGS grammar files.

The principle is that you load a main large grammar which has some references in it, to smaller user specific word lists grammars, which you would dynamically load.

See for the srgs format, and for the programmatic version.

By : Conor OG

This video can help you solving your question :)
By: admin