When I call the wxWebController::Execute(...), there's no result, and I test it. Then I found that, this line of code:
ns_smartptr<nsIScriptSecurityManager> security_manager;
security_manager = nsGetService("@mozilla.org/scriptsecuritymanager;1");
get an empty object of nsIScriptSecurityManager.
Please send me email if you have any idea of this problem. (tiger.public@gmail.com)
Thanks a lot!
Kirix Support Forums
JavaScript problem
6 posts
• Page 1 of 1
Re: JavaScript problem
wxWebControl::Execute() invokes a JavaScript function in the web content that's loaded in the web control. So, make sure this function is properly defined in the content you're loading, and then you should be able to call it with Execute().
For example, suppose you define a JavaScript function in your webpage as follows:
You could then invoke it as follows:
For example, suppose you define a JavaScript function in your webpage as follows:
- Code: Select all
function ShowMessage(message)
{
alert(message);
}
You could then invoke it as follows:
- Code: Select all
// TODO: create instance of wxWebConnect called m_browser
wxString message = wxT("Hello, World");
m_browser>Execute(wxString::Format(wxT("ShowMessage('%s');"), message.c_str()));
Aaron Williams
Kirix Support Team
Kirix Support Team
-
Aaron - Kirix Support Team
- Posts: 120
- Joined: Fri Dec 16, 2005 3:01 pm
Re: JavaScript problem
Test html page:
then I use execute(how you write up), program crashed. What something wrong?
- Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" language="JavaScript">
function ShowMessage(message)
{
alert(message);
}
</script>
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
<title></title>
</head>
<body>
<form action="http://*****/1.php" method="POST">
<input name="login" value="vovanchig" />
<input name="password" type="password" value="123" />
<input type="submit" name="smb" value="submit" />
</form>
</body>
</html>
then I use execute(how you write up), program crashed. What something wrong?
- qbin
- Registered User
- Posts: 10
- Joined: Thu Jul 30, 2009 8:05 am
Re: JavaScript problem
Hi there,
Are you using a different version of Xulrunner? What's the version number you are using?
Ben
Are you using a different version of Xulrunner? What's the version number you are using?
Ben
Ben Williams
Kirix Support Team
Kirix Support Team
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
Re: JavaScript problem
Xulrunner 1.8.1.3
From link in this site.
From link in this site.
- qbin
- Registered User
- Posts: 10
- Joined: Thu Jul 30, 2009 8:05 am
Re: JavaScript problem
Also getting this issue with xul runner 1.9. The sample from Mozilla works fine but cant get WebControl to work.
- lodle
- Registered User
- Posts: 2
- Joined: Mon Nov 30, 2009 1:59 am
6 posts
· Page 1 of 1
Return to wxWebConnect Questions, Thoughts & Feedback