[Qt-interest] how to pass strings as args to evaluateJavascript() call?
Karthick
sppkarthick at gmail.com
Mon Mar 14 07:43:24 CET 2011
Hi All,
How to pass strings as args to evaluatejavascript() call?
For example:
I have a Javascript function in HTML which is given below.
calcRoute(origin, destination);
I have tried the following way.
In Qt:
I am calling JS function like evaluateJavascript("calRoute('germany',
'italy')");
In this case, no issues. Here i passed the hard coded value.
Instead of that, i will pass two strings as given below.
char *str1, *str2;
//memory allocation for str1 and str2
strcpy(str1, "germany");
strcpy(str2, "italy");
evaluateJavascript("calcRoute(str1, str2)");
In this case, no compilation error. but i am not getting proper output.
whether is this correct way to pass strings like the one above or will do it
in sum other way to pass?
If anyone knows, please help me to solve this issue.
--
*Regards,*
*Karthick
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110314/6c6296ca/attachment-0001.html
More information about the Qt-interest-old
mailing list