PeterHuppp
asked on
Javascript errors in VFP form using oleControl
So sample code to illustrate the problem. When I try to navigate the olecontrol to a page that uses javescript I get an error (see picture). Not sure how to get the webpage to work properly in the oleControl. Any help would be appreciated.
ox = CreateObject("MyInternetExplorer")
ox.visible = .t.
ox.oweb.navigate("http://mintpal.com")
DEFINE CLASS MyInternetExplorer AS form
ADD OBJECT oWeb AS CWeb
caption = "My Internet Explorer"
PROCEDURE init
THISFORM.LEFT = 0
THISFORM.WIDTH = SYSMETRIC(1) * 3/4
THISFORM.height = SYSMETRIC(2)*3/4
THIS.Resize
PROCEDURE resize
This.oWeb.resize
ENDDEFINE
DEFINE CLASS CWeb AS olecontrol
oleclass = "Shell.Explorer.2"
PROCEDURE Resize
THIS.Width = THISFORM.Width - 10
THIS.Height = THISFORM.Height - 10
PROCEDURE Refresh
nodefault
ENDDEFINE
scripterror.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It is difficult to write JavaScript code compatible to all existing browsers or browser OLE controls. It is similar like the FoxPro code running under various FoxPro versions...
Your only option is to ask the JavaScript code author for a fix.
Your web page example is not so bad. Some scripts do not run at all under certain browsers or they just freeze the browser...
Your only option is to ask the JavaScript code author for a fix.
Your web page example is not so bad. Some scripts do not run at all under certain browsers or they just freeze the browser...
ASKER
so is nothing to be done to have it in a window inside a form that will work with javascrypt?
I wouldn't tell it so strictly... The JS code works inside the form in your case just some error messages are suppressed.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for PeterHuppp's comment #a39930331
for the following reason:
Although not a perfect solution it is working.
Accepted answer: 0 points for PeterHuppp's comment #a39930331
for the following reason:
Although not a perfect solution it is working.
Windows does not mean perfect World... And better (and cost effective) solution does not exist in this case.
BTW, why did you select your post as the solution?
BTW, why did you select your post as the solution?
ASKER
Not a perfect solution but not sure one is to be found.
What was the javascript error anyway? It's an error in the javascript code, neither in VFP nor in IE, nor in the Webbrowser Control, it just shows there.
So either it's as simple as allowing javascript at all in you IE internet settings, or let the developers of mintpal.com fix it.
Bye, Olaf.
So either it's as simple as allowing javascript at all in you IE internet settings, or let the developers of mintpal.com fix it.
Bye, Olaf.
ASKER
Revised from above
Open in new window