Solved

jQuery/AJAX Form not working on certain computers

Posted on 2015-01-12
8
341 Views
Last Modified: 2015-02-09
We received a chat from a fellow who was trying to register with us using a 4 page jQuery/Ajax form i created.
He said he was using Chrome, and as part of the chat transcript, I can see he's using the same version of Chrome I am. (in fact, our user agents are the same - except he's on Windows 7 and I'm on 8.1)...  Turns out he gets the same error in Internet Explorer.  The error is the page just refreshes, it doesn't load the inner content.  Here's the code:

<script language="javascript">
$(function(){
	$('#startReg').click(function(){
		$( ".right_cont_sub" ).fadeOut("slow", function(){					
		$.ajax({
				url: "manager/manager1.html",	
				cache: false
			   })
		.done(function(html){
			
			$( ".right_cont_sub" ).html( html );
			$( ".right_cont_sub" ).fadeIn("slow");
			$( ".statusReg" ).fadeOut("slow", function(){
				$(".statusReg").html = "";
			});
		});
		return false;
	});
	return false;
	});
});
</script>

Open in new window


I've tested the script on a number of computers and browsers, so I'm trying to figure out what could be the problem.  Other people have registered without any issues.  Unfortunately, I'm not in a position where I can have this person test their setup, so instead I'm trying to keep it from happening again.

Is it possible that Anti-Virus or security settings could disable jQuery or AJAX code?  Could there be some other factor that I should consider?  

Thanks for your help!!!
0
Comment
Question by:slightlyoff
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Accepted Solution

by:
ambience earned 250 total points
ID: 40546301
I think I have seen an exactly similar question here on EE before and in that the server end of the API was returning responses with an HTTP response code of 304 (Not Modified). This could lead to intermediaries caching content and subsequent requests not even hitting the server.

Can you check server logs to see whats exactly being returned? Also, Chrome has dev tools like Firebug so would it be possible to obtain logs of what exactly happens for such requests?
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40548094
Can you also please post your form as it could be the onsubmit function is still being executed.
0
 
LVL 1

Author Comment

by:slightlyoff
ID: 40558772
Sorry for the delay in responding.  The issue isn't the form - it's the button that triggers the jQuery to open the div and display the form.  Literally, I just have a button with an ID of "#startReg" - and this is where the problem starts.

I wonder if there's an issue with jQuery on users' computers...
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40569122
thinking outside the square... how are you including jQuery in your site? via a CDN or are you hosting it? It sounds like the library isn't being downloaded, which could possibly exhibit this kind of behaviour.
0
 
LVL 22

Expert Comment

by:ambience
ID: 40570235
You don't clearly state the nature of errors, don't answer questions, and don't respond in time. Seriously, you expect someone to be able to help you?
0
 
LVL 1

Author Comment

by:slightlyoff
ID: 40596287
Fair enough ambience - this is one of several issues I've been trying to solve and had to launch a website between these posts, I've been awful at following up, and it doesn't show respect.  I'm sorry.  I really do appreciate your time and your input.

I have not had anyone else complain of this issue, so it's been set on the back burner - but because it could still exist, I am interested in solving it.  

To answer the questions - as i understand them:
1. The jQuery is included in the site, not via CDN.  
2. Here's the link that triggers the jQuery: <a id="startBand" href="#"><img src="images/button.jpg" border="0" /></a>, it's not a form.  I'm using jQuery

As for stating the error, this happened once and I can't recreate it - no error code was returned.  I don't expect this problem to be solved via Experts Exchange, I was really just wondering if is possible that Anti-Virus or security settings could disable jQuery or AJAX code.  Every single other browser, OS i've tried this on works fine.

I'll leave this question open for a couple of days in case you would like to respond, if not, I'll award the points - since you both have gone above and beyond in trying to help.  

Thank you!
0
 
LVL 42

Assisted Solution

by:Rob Jurd, EE MVE
Rob Jurd, EE MVE earned 250 total points
ID: 40596290
Sounds more like an intermittent network issue. If it does happen again, first thing to check is the console of the developer tools.

You could also build into your site that it checks for necessary libraries such as jQuery and alerts the user if it isn't present. JQuery is as simple as:

If(! JQuery) {
   //notify that jQuery library hasn't loaded
}

Obviously include YOUR script after including the jQuery library.
0
 
LVL 1

Author Closing Comment

by:slightlyoff
ID: 40598294
Thanks for the advice.  I will see if the issue happens again and try to log it better.
Sorry for the slow responses!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question