I am trying to make use of JavaScript interface of nsdejavu plugin in Firefox
3.0.16. My tests show that by default this interface is not available. This is
how I place DjVu contant on my page:
<script type="text/javascript">
function FunctionFiredByAbuttonClick\(\)
\{
var v1 = document.getElementById\("djvu1"\);
alert\(v1.version\); // 'undefined' is returned
return false;
\}
</script>
I looked at nsdejavu.c source file and there is a flag 'scriptable', it is by
default 0, and it seems to be somehow set in StartProgram(void) function. My
problem is that I have no idea how to activate this flag from HTML/javascript
or browser settings(?). My temporary solution was to set this flag to 1 in
sorce file and recompile the library. Now it works! But I suppose there must
be some other way to enable scripting interface.
I will appreciate any suggestions.
Regards,
Pawel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems that it was wrong when I said that the solution of simply setting the
'scriptable' frag to 1 works. Javascript functions and properties available,
but when I invoke getdjvuopt('page') method, I got an exception 'uncaught
exception: Error calling method on NPObject! .'. I suppose the plugin was not
properly initialized.
Waiting for your help…
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to make use of JavaScript interface of nsdejavu plugin in Firefox
<object id="user-content-djvu1" data="djvu3spec.djvu" type="image/vnd.djvu" width="75%" height="100%"> <param name="page" value="1"> <param name="zoom" value="stretch"> This browser cannot render djvu data. </object>3.0.16. My tests show that by default this interface is not available. This is
how I place DjVu contant on my page:
And this how I try to use JavaScript interface:
<script type="text/javascript"> function FunctionFiredByAbuttonClick\(\) \{ var v1 = document.getElementById\("djvu1"\); alert\(v1.version\); // 'undefined' is returned return false; \} </script>I looked at nsdejavu.c source file and there is a flag 'scriptable', it is by
default 0, and it seems to be somehow set in StartProgram(void) function. My
problem is that I have no idea how to activate this flag from HTML/javascript
or browser settings(?). My temporary solution was to set this flag to 1 in
sorce file and recompile the library. Now it works! But I suppose there must
be some other way to enable scripting interface.
I will appreciate any suggestions.
Regards,
Pawel
PS. What I should precise is that I use version 3.5.22 of DjVuLibre
It seems that it was wrong when I said that the solution of simply setting the
'scriptable' frag to 1 works. Javascript functions and properties available,
but when I invoke getdjvuopt('page') method, I got an exception 'uncaught
exception: Error calling method on NPObject! .'. I suppose the plugin was not
properly initialized.
Waiting for your help…
…what is intersetnig setdjvuopt(key, value) works fine, while getdjvuopt
doesn't as I said above