Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
How detect my internet connection without using navigator
ashok kumar
Aug 26 2013 5:42 AM
1.3k
Reply
Hi all,
I need to detect whether Internet connection is there when my script loads, i used navigator.online it says" connection is there " if the PC in LAN and able to connect to internet, and also the path to my Gmap js files should load according the connection settings online and offline settings intially i tried
$(document).ready(function () {
$.ajax({
url: 'http://in.yahoo.com/',
success: function (data) {
alert('Connection.');
},
error: function (data) {
alert('No Connection.');
}
});
});
but this is also not working.
iam getting error like
XMLHttpRequest cannot load
http://in.yahoo.com/
. Origin
http://localhost:40624
is not allowed by Access-Control-Allow-Origin.
For which i added
protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*"); }
in my Global.asax file
PLs suggest me i nearly spend a Day in searching,pls help me out
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
pass large json string with jquery to web service
Code for Simple calculator in jquery