I am writing a simple napapi plugin where I have to print the value passed from javascript function in html page. But I am facing problem while doing it. It works properly on firefox. But I want to do it on qt fancybrowser example. The value printed is always 0 no matter whatever value I pass in javascript code.
The javascript code is as follows :
<html>
.....
<script>
function process_data()
{
PluginObject = document.getElementById("Object");
var i =100;
if(PluginObject){
ret = PluginObject.process_Data(i);
}
}
</script>
....
</html>
The plugin code is as follows :
.....
bool ScriptableObject::process_Data(const NPVariant* args, uint32_t argCount, NPVariant* result)
{
printf(" process_Data\n");
printf("\t argCount : %d\n",argCount);
int tempi =args[0].value.intValue;
int tempf =args[0].value.doubleValue;
printf("type: %d type: %u\n",args[0].type,args[0].type);
printf("tempi : %d tempf : %f\n",tempi,tempf);
}
......
The output is as follows :
process_Data
argCount : 1
type: 4 type: 4
tempi : 0 tempf : 0.000000
Actually it should print 100 which is the value passed in var i from javascript.
Any suggestions/comments are welcome
Thanks in advance