• Hi guys.

    I’m working on a plugin that uses a shortcode. The code that runs to produce output for the shortcode can sometimes take a while to complete so currently there is just a blank space on the post until the shortcode returns some text.

    I have looked around Google (with no success) for some code to implement some “loading” text for the shortcode. The idea is that when the page loads, the shortcode can display “Loading results” (or similar) until the code has completed at which point the “Loading results” text can be replaced with the actual results.

    I was hoping someone here could provide some boilerplate code for this or point me towards some documentation or tutorial that covers this functionality.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can insert a loading div like <div id="loading-div">Loading...</div> and then use the Ajax ‘success’ function to hide this div after the function completes.

    Thread Starter psycic101

    (@psycic101)

    Thank you, Patrick. That worked perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcode loading text’ is closed to new replies.