Jump to content

Whats the easiest way


Kovo

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...