我正在为 windows phone 平台创建一个应用程序,并且需要在用户浏览网络时获取网站标题。
我尝试了很多方法,但它似乎不起作用。有任何想法吗 ?
这就是我所拥有的:
String title = (string)browser.InvokeScript("eval","document.title.toString()");
我正在为 windows phone 平台创建一个应用程序,并且需要在用户浏览网络时获取网站标题。
我尝试了很多方法,但它似乎不起作用。有任何想法吗 ?
这就是我所拥有的:
String title = (string)browser.InvokeScript("eval","document.title.toString()");
I don't know why the above answer was accepted as the right one:
The following line should work:
string webTitle = (string)Browser.InvokeScript("eval", "document.title.toString()");
if you call this in the navigated event it may not work, you MUST call this in Browser_LoadCompleted event, because only here all background processes finished and the invokeScript would work