I manually have a constructed web page in a string for displaying in WebBrowser control (part of code)
ie.Document.clear
str = "<!DOCTYPE html>" & vbCrLf _
& "<html>" & vbCrLf _
& "<head>"
& vbCrLf _
& "<script src=""http://code.jquery.com/jquery-1.10.2.js""></script>" & vbCrLf _
& "<script>" & vbCrLf _
& "$(function() {" _
& "$( ""#dialog"" ).dialog();" _
& "});" _
& "</script>" & vbCrLf _
& "</head><body>" & vbCrLf _
ie.Document.write str
ie.Document.Close
After many hours of investigation, I finally concluded that JQuery external *.js script isn't loaded at time that WB parser reaches the dialog() function. Even I put the file locally (with local path) isn't loaded.
The IE error is "The value of property $ is null or undefined...".
The HTML (constructed) code is OK because I did a very simple test. I saved the WB page source via right click -> page source, I saved locally as *.htm and back in MSACCESS, I use navigate WB's method
ie.Navigate "file:///V:/...file.htm"
And this is working just fine.
So the question is why
ie.Document.write str -> not working
ie.Navigate -> works
I need the first method since I use WinHTTP to make a request, take some real page, parse and finally display in WB.
Of course, I could manipulate emulation from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION which btw works but this will fall into several problems on other machines where I cannot have access to registry.
Thanks in advance,