Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 505
  • Last Modified:

Javascript/JQuery not working initially...page requires refresh

Using ASP.net I am created a web application which features JQuery and Javascript.  I'm finding that somewhat regularly javascript events associatd to button and text box controls are not running.  If I refresh the page with F5 it will  then work.  What would be causing this and how can I fix it?

I first noticed it on my development station (Visual Studio 2010 with IE 9) but users did not report the problem in production.  I have started getting calls from users on the production  system so am getting worried!
0
canuckconsulting
Asked:
canuckconsulting
1 Solution
 
Chris StanyonCommented:
It's impossible to tell without seeing your site.

Check to make sure the elements with the events are actually loaded when you do the binding by wrapping all of your jQuery stuff inside the $(document).ready function. Without this your script may try to run before the DOM is loaded.
0
 
vinhnlCommented:
Do you see javascript bugs on status bar ? Which javascript events have you used ?

If you have a bug in javascript, maybe ie will block all client events on your site
0
 
Derek JensenCommented:
Yeah, definitely check for errors; I've set up my system to auto-popup page errors in IE, so I *always* see them. Annoying, I know, but considering I use FF most the time...
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
canuckconsultingAuthor Commented:
Frustratingly it doesn't seem to break in firefox.  How can I configure I configure ie to pop up the errors?  This sounds like a useful way to test my site.
0
 
Derek JensenCommented:
Indeed, let me track down how I did that; I remember it was pretty buried, not in your typical configuration locations...you're on Windows 7, right?
0
 
canuckconsultingAuthor Commented:
Yup, w7 with ie9.  Thanks.
0
 
Derek JensenCommented:
Ah! That was easy! It's just in Internet Options->Advanced settings, under Browser. :)Always display errors
0
 
canuckconsultingAuthor Commented:
I'm almost too embarrased to say the issue.  All my pages started with:

$('document').ready

Not

$(document).ready

Tragic.  Thanks for your help.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now