TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ashok kumar
NA
89
36k
How detect my internet connection without using navigator
Aug 26 2013 5:42 AM
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
Reply
Answers (
1
)
pass large json string with jquery to web service
Code for Simple calculator in jquery