I'm sorry if my question was vague. I want to retrieve data from a server while using an Activ eBook.I wasn't able to find a way to return data using
the following (return to eBook) format.
var targetURL="('##NAVIGATE('Activ_eBook_Page.htm')";
parent.location=targetURL;
But for anyone who needs to retrieve data from an online server using PHP, here is a simple solution.
PHP has the capability to create and store data in an online text file using the following code snippet in a PHP code section.
$some_text = "here is my\ntext over few\nlines";
$fw = fopen("/path/file","w+"
; //will create file if not existing
fwrite($fw,$some_text);
fclose($fw);
[color=red]In practice it could look like this...[/color]
$some_text = "myvar=3"; // variable you want to pass
$fw = fopen("webdata.jgp","w+"
; //file created on server
fwrite($fw,$some_text);
fclose($fw);
This text file will actually be a JavaScript include file i.e. "webdata.js". Unfortunately Browsers cache ".js" files so if you need this data to be updated on subsequent calls you must name the extension something other than ".js"
To retrieve this data you need a statement in your HTML page.
<html>
<head>
<title>myWebDoc</title>
[color=red]<SCRIPT LANGUAGE="JavaScript" SRC="http://server_location/webdata.jgp"></SCRIPT>[/color]
<SCRIPT language='javascript'>
if (myvar == 3){
alert ("its3"
;
}
else{
alert ("itsNot3"
;
}
// your JavaScript code will retrieve "myvar" value from online "webdata.jgp"
</script>