Put Ajax in the page so that either (A) the page is incomplete offline or (😎 the page doesn't even begin to function offline.
Of course, the broader question is, why would you care if someone views it offline? Isn't it a good thing that they are viewing your page at all?
And to get technical about it, a web browser downloads stuff first and then displays it "offline" so technically, to protect against downloading and offline browsing, the only solution is to delete your web page from the Internet now.