eBook authors eBook Software - create and publish your own ebooks
Create your own eBooks
Learn How To Create, Publish & Market E-Books
E-Book Creation Software
Add sophisticated multimedia to your E-Books
Create E-Book covers in minutes
E-Book Marketing & Promotion made easy
Search engine for E-Books
Interviews with eBook authors
Tools for building better eBooks
Archived Message:

Check for internet connection

mike I wish to incorporate some pages on the net into my ebook.

I would like to check whether an active internet connection exists before attempting to access these pages.

Is there a way of checking for internet connection and then diverting to an appropriate error page if connection is not found...rather than end up a page not available message?

Posted on: 11:18 am on July 7, 2003
Alaska Mike -

 Include a reference in your ebook to a .js file living on your web server; the js. file contains a variable like "AreWeOnline = 1;".

Your book starts out with the same variable set to '0'.  It checks the .js file online.  If you are not online, it will not throw an error or 404 page.  If you are online, the 'AreWeOnline' value is 1.

 Base all your decisions thereafter on the '0' or '1'.  Your images, for instance, can be named 'WebLinkGlobe0.jpg' (a disabled gray web link image) and 'WebLinkGlobe1.jpg' ( a normal image ), and you can swap between images based on that value.

 something like:

 document.write("<img src='WebLinkGlobe" + AreWeOnline + ".jpg'>" ) ;

 ...and *presto*, your icon indicates whether you are online or not.

 best -


Posted on: 9:42 pm on July 7, 2003
mike Thanks Roger....thats an interesting suggestion which I will make use of.

However my request was on a slightly different topic-

I wanted a means of checking whether the ebook user had an active internet connection at the time of using the ebook not whether or not the author was online. Any ideas on this problem?

Posted on: 3:11 pm on July 8, 2003
Alaska Ok, now I'm confused.

The author is not involved here.  The bit o'script is in the finished ebook, and, upon opening, checks if the user (reader) has internet access.

In order for the book to check if you have 'an active internet connection', it goes online.  It seeks some kind of web connection.  Just like you would with your browser.

If you want the information to persist, as in, 'Yes, the user had access when he opened the book the first time', you still need to test for the connection, and then save that value in, say, an .ini file.

You still need some way to retrieve a value, indicating yea or nay.

(Edited by Alaska at 2:06 am on July 9, 2003)

Posted on: 5:33 pm on July 8, 2003


List All Archived Forums

Copyright © 2000-2018, Answers 2000 Limited.

With any business, it is up to the individual owner of said business to ensure the success of the business. You may make more or less than any sample figures or results that might be quoted on our web sites or other publications. All business involves risk, and many businesses do not succeed. Further, Answers 2000 Limited does NOT represent that any particular individual or business is typical, or that any results or experiences achieved by any particular individual/business is necessarily typical.

Disclosure: Our company's websites' content (including this website's content) includes advertisements for our own company's websites, products, and services, and for other organization's websites, products, and services. In the case of links to other organization's websites, our company may receive a payment, (1) if you purchase products or services, or (2) if you sign-up for third party offers, after following links from this website. Unless specifically otherwise stated, information about other organization's products and services, is based on information provided by that organization, the product/service vendor, and/or publicly available information - and should not be taken to mean that we have used the product/service in question. Additionally, our company's websites contain some adverts which we are paid to display, but whose content is not selected by us, such as Google AdSense ads. For more detailed information, please see Advertising/Endorsements Disclosures

Our sites use cookies, some of which may already be set on your computer. Use of our site constitutes consent for this. For details, please see Privacy.

Click privacy for information about our company's privacy, data collection and data retention policies, and your rights.

Contact Us    About and Terms Of Use    Privacy    Advertising/Endorsements Disclosures