Download Ajax dynamic content script


Bookmark and Share


This script is distributed under the LGPL open source license.
Commercial licenses are also available. Some of these licenses also includes personal e-mail support for up to 1 year.

Download files

You can download the script from this Zip file.

Files in package:

  • ajax-dynamic-content.html = Demo HTML file which illustrates how to use this script.
  • js/ajax.js = Ajax (SACK library)
  • js/ajax-dynamic-content.js = Main JS file for this script
  • images/* = Images used in this demo
  • external/* = Dynamic loaded files for this demo

How to use this script

This scripts loads content of external files into a HTML element on your page. This is simply done by calling the Javascript function ajax_loadContent. Example:


This will load the content of the file external/externalfile1.html into the HTML element on your page with id "news1", example: <DIV id="news1"></DIV>

Note! Ajax scripts must be executed over http and not the file system. I.e. from address starting with http://... and not C:\...

Update log

  • December, 3rd, 2006 - Javascript parser has been improved because of problems executing code in global context


Tom Walsh
Does not workSays Loading content - please wait
Tom Walsh at 07:14PM, 2011/03/03.
Admin comment
Tom,Take a look at this post:, you'll find a solution to your problem there.
DHTMLGoodies at 01:02PM, 2011/03/07.
Still not working
Pritee at 12:51PM, 2011/03/24.
Its not working locally but when you upload on your server its work :) Thanks!
Pritee at 01:01PM, 2011/03/24.
Does it work with post requests?Thanks
Nico at 11:57PM, 2011/05/10.
Greg Giddings
Can you link between the divs?
Greg Giddings at 11:59AM, 2011/06/11.
Its not working on the server on Firefox and Opera. It's good only for IE.
aneta at 08:28PM, 2011/06/12.
Admin comment
Aneta,It's working perfectly in my Firefox in Opera. Which problems do you experience? Any error messages ?
DHTMLGoodies at 01:25PM, 2011/06/15.
Oh, sorry. It was my mistake. Now it's good. Here are my attempts: :)
Aneta at 09:22PM, 2011/06/15.
Just says "Loading content - please wait" the entire time. I can't get example to work. I changed to GET method , too. still doesn't work.
tracy at 05:16PM, 2011/06/27.
Why isn't it working when calling ajax_loadContent(...) in a loop?
um at 10:54PM, 2011/08/02.
Hello ! I need to use checkbox and radio buttons for this form but it don't works...!How could I do ?Thanks
Pierre at 02:08PM, 2011/09/09.
Ahmad Rameen
thanks it is good, but can you add a sidebar in this, that it must also change in different pages. thanks
Ahmad Rameen at 09:54AM, 2011/10/19.
Michael Owen
This is what I am trying to do! I have a php script, by default it gets all results from the database... this is loading perfectly with this script. What I would like to do is have a search form (method post) where users can narrow their results with search criteria. the search works great outside of the dynamic content script but I would like it to update the content div with the results of the new query. any tips on how I could implement this.
Michael Owen at 08:43PM, 2011/12/04.
does anyone can help me I want to use this script in my J2EE project I am under jsf 2.0 and I see my pages for external components does not work with jsf components against simple html works well.example <h:inputText value="Merci"/> does not work and <input type="text" value="Merci"/> works well.
yeli at 05:55PM, 2011/12/09.
We are using the Ajax dynamic content script and all is working BUT when we are loading an php ore html page with Frence, Spanish, German contex all the words whit special carracter like ^, accents etc will be shown with a ?.How can we let shown this correctly?Thanks in advanceEtienne
Etienne at 05:31PM, 2012/05/24.
How can i add a new html section in a existing html section using ajax and dojo?
Can anyone help me? its urgent.
Ria at 02:16PM, 2012/11/21.
Hi,great work by the way!!Would it be possible to link some file in Sugar Sync or Google drive? I tried but did not work!Tnx
alf at 10:27AM, 2012/12/20.
Could you put the example working on production?
Felipe at 01:24PM, 2013/01/31.
Diego Carlos
I'ts Working! Thx!
Diego Carlos at 06:58PM, 2014/06/16.
Hi Can I make a link to a page on an other site in the script?So yes how I must do that?Thanks in advance
Etienne at 11:48AM, 2014/09/24.
John G
Nice, simple and effective.
John G at 03:33AM, 2019/09/05.

Post your comment

Don't have an avatar? Create one at

Confirmation code:

Go to

About/Contact | A good idea? | Submit a script | Privacy notice
© 2005 - 2024