Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

Click form button, refresh <div> with JQuery

Hello All

I am converting all my extremely load code with shorter more flexable code.
The below I found for clicking a link to refresh a div.

This is not working?
My Button
<input type="submit" name="Submit" value="Save"  class="lButton" id="Save" />
<div id="tableContainer">content here</div>
my code---------------
$(function() {
      $("#Save").click(function(evt) {
         $("#tableContainer").load("http://site.com/Server/MyRefreshBox.asp")
         evt.preventDefault();
		 return false;
      })
    })

Open in new window



I also have this code, which refreshing on a timer.
Would love to get it to work if possible on a Button click

var auto_MemLoad = setInterval(
function()
{
$('#MemLoad').fadeOut('slow').load('http://site.com/Server/MyRefreshBox.asp').fadeIn("slow");
}, 30000);

Open in new window


Any ideas would be great on this issue.

Thank You
Carrzkiss
Avatar of MAHMED
MAHMED
Flag of Canada image

you will find the answer here at: http://forums.asp.net/t/1130175.aspx


ASKER CERTIFIED SOLUTION
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ValiMihai
ValiMihai

It surely appears to be a jQuery conflict with another library.

Try replacing the "$" in your code with "jQuery" and try it again.
Avatar of Wayne Barron

ASKER

Thanks for your input Vali
What I am using now, is working so I am going to stick with it.
I will look in on this issue at a later date if the code is needed.

Thank You
Carrzkiss
I just ran into an issue with Google Chrome and IE8 not refreshing on the button submit
FireFox is working as expected.

So.

Back to the other code.
I did as you suggested and still a no-go.


Any idea's (or) better yet, and actual working code would be GREAT! about now.
That works across all browser platforms.

Thank all;
Carrzkiss
jQuery(function() {
      jQuery("#Save").click(function(evt) {
         jQuery("#tableContainer").load("http://site.com/")
         evt.preventDefault();
		 return false;
      })
    })

Open in new window

I am set.
Everything is working now.

I had to remove this part from the code.
                    if(xmlHttpCor.readyState==4){
}

Once I removed it, IE8 started refreshing OnSubmit of the form.

This part will function in IE6 and IE7
But will not function in IE8 and has to be removed in order to refresh the page on Form Submit.

Take Care All;
Carrzkiss