wordSmith
wordSmith

Reputation: 3183

Go offline and reconnect with javascript / jquery

Is there a way I can go offline and reconnect with javascript / jquery. I am hoping to do this in hopes of establishing a better connection, hopefully.

The only way I can think of doing this is triggering the offline event with jQuery's .trigger('offline'); and then somehow reconnecting.

Is there a better way to do this? And / Or a way I can establish a stronger connection?

Upvotes: 0

Views: 417

Answers (1)

Jeff
Jeff

Reputation: 14279

What kind of environment are you developing in? Since you're using jQuery, I assume you are in a browser. If that is the case, then no, you cannot affect the computer's network connection with JavaScript. Think of how awful that would be if every website you visited could hijack control of your internet connection!

Upvotes: 4

Related Questions