2011-08-23 38 views

回答

1

Windows Phone 7运行IE9的移动版本,所以应该没有问题执行JavaScript。我可以用少量的信息来想到的唯一的事情就是你正试图在应用程序中使用webbrowsercontrol。在这种情况下,您应该将IsScriptEnabled属性设置为true以在控件中启用脚本。

0

chirag!

在窗口手机7中,您可以启用Javascript。

在xaml中,您可以设置isScriptEnabled = true。

Examle:

<phone:WebBrowser HorizontalAlignment="Left" Width="480" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Visible" Name="webBrowser" Height="80" VerticalAlignment="Bottom" IsScriptEnabled="True" ScriptNotify="webBrowser_ScriptNotify" Navigated="webBrowser_Navigated" Navigating="webBrowser_Navigating" /> 

您可以使用事件:

private void webBrowser_ScriptNotify(object sender, Microsoft.Phone.Controls.NotifyEventArgs e) 
     { 
      //your code : e is returned from the javascript code if javaScript is active 
     } 

您可以向下通过使用负载HTML内容:Web客户端或string htmlcontent = webBrowser.SaveToString

希望这有助于! Thongaduka