Let's say I have an online web page displayed within the Activ ebook window.
Can Activ's window.external object retrieve the href (the current URL), of this web page? Or is there some other way within Activ?
If anyone has done this, I would appreciate hearing how they went about it.
best -
Posted on: 7:50 am on January 13, 2005
EBookCompiler
I haven't tried this, but what about {ebookurl}
Or in JavaScript, something like
var s = window.external.ActivGet('{ebookurl}') ; alert(s) ;
Posted on: 2:04 pm on January 13, 2005
Alaska
Thanks, Sunil -
That works perfectly to get the name of the current page. Of course, we always have something in mind to make it a bit harder...
Is there a way to make the ebook know, or monitor, so to speak, when the {ebookurl} changes?
I guess I basically need to know when there is a new contents page, so Activ can compare that new URL with those in my list (ok, an array).
Can I have a loop (either Activ or Javascript) running in the background (using the startup event) to check for page changes? It seems as though the Activ loops have to run their course before it relinquishes control and loads the first page.
Can I use JavaScript to watch for it while the ebook runs? Would JavaScript work in an .as file?
I know, that's 3, maybe 4 questions, but all with the same aim. If I can work this out, I can breathe easier.
thanks again!
Posted on: 12:11 am on January 14, 2005
EBookCompiler
> Is there a way to make the ebook know, or monitor, so to speak, when the {ebookurl} changes?
I don't think so, with the possible exception given below.
> Can I have a loop (either Activ or Javascript) running in the background (using the startup event) to check for page changes?
I don't think you can do that with Activ Script or JavaScript.
Activ Scripts run and then stop, they can't sit in the background waiting for an event
JavaScript is the same, with the sole exception of the TimeOut functions. But these will reset when you load a new page, IIRC (you need to ask a JavaScript expert to be sure).
Possible exception, sort of: If the pages are all controlled by you, you might be able to use onLoad or onUnload JavaScript event
> Can I use JavaScript to watch for it while the ebook runs?
See previous answer
> Would JavaScript work in an .as file?
No
Can you try and explain more precisely what you want to achieve (I'm talking about end results you hope for, rather than the technical obstacles that you are trying to overcome), and perhaps there might be another approach to addressing the problem
Posted on: 1:57 am on January 14, 2005
Alaska
Sunil -
thanks for your responses...
Basically, I want to screen, or filter what the ebook can load online. I won't have control of all the linked pages it will access online, and I don't want a simple link to turn into a navigation odyssey.
I can do this if I call the pages to/from an inner frame, but this can have its complications.... For instance, some sites have anti-frame scripts that force the page to the top window, i.e.:
if (self != top) top.location.href = window.location.href;
If this happens, I lose control of the contents from there on out.
I guess I was hoping to find or create an 'onChange' or 'beforeOnLoad' event in Activ itself...
Maybe I can disable those frame-breaking scripts as they are loaded, or something... I'm open to most anything.
best -
Posted on: 3:51 am on January 14, 2005
EBookCompiler
If it's not your site, I'm not sure it's ethical to frame a site without permission, particularly if they have incorporated anti-framing code. I guess there could be legal issues around framing sites too (I have read of cases about this kind of issue with framing one web site inside another, but IANAL, and I don't remember the specifics)
I'm still not quite sure that I get what you're getting out, or why you need it.
It seems to me that the typical ebook link would probably go more like:
1. Here's some text in the ebook 2. here's a link to a web site with more info 3. user clicks the link, and web site opens in a new browser window 4. user knows that it's his responsibility if he decides goes off on some long trek thru web sites in the browser window
In other words, when a link opens in a new browser, provide it starts on the right initial page, I'd guess probably at least 95% of people don't consider it your responsiblity (as an author) to guide them any further. So, apart from functional issues (e.g. the user doesn't lose his place in the ebook), a new window also serves as a clear delination of where your responsibility as an author ends and the user's responsibility as a web surfer starts.
Posted on: 4:43 am on January 14, 2005
Alaska
...ah, but there's the rub: I'm not building an ebook, and that was the best description of the behavior I was looking for without divulging my idea. I'm not framing anyones site, claiming ownership.
... and the "why's" I really didn't want to discuss, other than to say that, when the frame forces it's way to the top, I don't want to lose my frames-friendly toolbar I built to replace Activ's.
thanks anyway.
best -
Posted on: 10:26 am on January 14, 2005
EBookCompiler
Roger, okay
If you want to email me privately you can
I did think of a way round this that might work (it might not too). However, be warned, this workround may also require a fair amount of work using the API.
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.