Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-02-2009, 11:44 PM   PM User | #1
php_guest
New Coder

 
Join Date: Jun 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
php_guest is an unknown quantity at this point
jquery problem with .load

I want to load everytime user click on Add more a page test.html where are inside html stored text fields for form. The problem is everytime I call the function, it removes the first test.html and shows again test.html but it should show an extra one without removing the first one. How to do that?

$(function() {

$('#clickme').click(function() {
$('#include').load('test.html');

Tnx!
php_guest is offline   Reply With Quote
Old 06-03-2009, 05:12 AM   PM User | #2
Eldarrion
Regular Coder

 
Join Date: Feb 2009
Location: Wheeling, IL
Posts: 358
Thanks: 5
Thanked 62 Times in 60 Posts
Eldarrion is on a distinguished road
jQuery load does exactly that... loads the contents of a file and puts them inside a location specified. You might want to use this instead (From jQuery's AJAX API):

Code:
$.ajax({
  url: "test.html",
  cache: false,
  success: function(html){
    $("#results").append(html);
  }
});
And the link to the page:

http://docs.jquery.com/Ajax/jQuery.ajax

I'm sure you can figure it out.
__________________
The way to success is to assume that there are no impossible things. After all, if you think something is impossible, you will not even try to do it.

How to ask smart questions?
Eldarrion is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:31 AM.


Advertisement
Log in to turn off these ads.