【发布时间】:2017-01-13 11:41:04
【问题描述】:
我有一个使用 Webview 控件的 UWP 应用。 webview 的来源是在 localhost 上运行的 asp.net Web 应用程序的 url。该 url 中编写了 javascript 函数。我的问题是如何从 uwp webview 控件调用用 web 应用程序编写的 javascript 函数。
<Page
x:Class="signalRonRPi3.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:signalRonRPi3"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<StackPanel>
<Button x:Name="callJS" HorizontalAlignment="Stretch" Margin="0,0,298,0" Click="callJS_Click" >Call JS</Button>
<WebView x:Name="webViewUrl" Source="http://localhost:52527/Home/Image" Height="500" Width="500" Margin="50" />
</StackPanel>
如何从这里调用源 url 中编写的 javascript 函数?
【问题讨论】:
标签: javascript c# webview asp.net-mvc-5 uwp