Jump to content

Whats the easiest way


Kovo
 Share

Recommended Posts

to insert HTML onto a page on the fly or by request using ajax? Now, I dont mean import an external html file into a div, but I mean, literally import html code (predefined somewhere) and place it on the page. And Id want this to happen infinitely. For example, I want a button on a html page to insert the following: <div>blah</div><div class="ff">ddd</div>etc...Now everytime I click this button, it will insert that html into the page.Is AJAx my answer or am I looking at the wrong client-side script?

Link to comment
Share on other sites

If it's just plain HTML content, you could simply generate the HTML within JavaScript itself by the create*() methods.AJAX is useful if you need to make a request to a dynamic page (i.e. generate dynamic data/presentation).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...