Internet explorer windows phone IE中的连字符

Internet explorer windows phone IE中的连字符,internet-explorer,windows-phone-7,hyphen,Internet Explorer,Windows Phone 7,Hyphen,需要在windows phone 8上的IE中使用连字符(或在7/8上使用更好的连字符)。我使用web浏览器控件来显示内容,并嵌入一些css以使排版更美观。看来IE的手机版真的是太差劲了!例如p:first child:first letter不起作用。hyphens:auto也不起作用。是否有变通办法向边缘文本添加连字符 PS正在尝试,但有一个问题,因为找不到将本地脚本包含到webbrowser控件的页面中的方法(im使用NavigateToString)。您可以引用本地javascript文

需要在windows phone 8上的IE中使用连字符(或在7/8上使用更好的连字符)。我使用web浏览器控件来显示内容,并嵌入一些css以使排版更美观。看来IE的手机版真的是太差劲了!例如
p:first child:first letter
不起作用。
hyphens:auto
也不起作用。是否有变通办法向边缘文本添加连字符


PS正在尝试,但有一个问题,因为找不到将本地脚本包含到webbrowser控件的页面中的方法(im使用NavigateToString)。

您可以引用本地javascript文件,但需要先将其加载到独立的存储中

这就是如何将它们加载到本地存储中

var fileResourceStreamInfo = Application.GetResourceStream(new Uri("scripts/Hyphenator.js", UriKind.Relative));
if (fileResourceStreamInfo != null)
{
using (BinaryReader br = new BinaryReader(fileResourceStreamInfo.Stream))
{
    byte[] data = br.ReadBytes((int)fileResourceStreamInfo.Stream.Length);

    string strBaseDir = "scripts";

    if(!appStorage.DirectoryExists(strBaseDir))
    {
        //Debug.WriteLine("Creating Directory :: " + strBaseDir);
        appStorage.CreateDirectory(strBaseDir);
    }

    // This will truncate/overwrite an existing file, or 
    using (IsolatedStorageFileStream outFile = appStorage.OpenFile(AppRoot + "scripts/Hyphenator.js", FileMode.Create))
    {
        Debug.WriteLine("Writing data for " + AppRoot + "scripts/Hyphenator.js" + " and length = " + data.Length);
        using (var writer = new BinaryWriter(outFile))
        {
            writer.Write(data);
        }
    }
}
}

然后您可以这样引用它们:

<script type="text/javascript" src="scripts/Hyphenator.js"></script>


不错!谢谢,我会尽快尝试。你确定我可以通过scripts/myJavascript.js访问我的脚本文件吗?使用此方法并使用此代码访问脚本(文件位于根目录中):
当您可以从web引用Hyphenator.js时,请继续使用该方法。我的理解是,你想将js文件打包到应用程序中,并从应用程序内部加载它,而不依赖于互联网连接。是的,你正确地理解了我:我想用hypens打开页面,即使没有互联网也能正常工作。现在,我从独立存储中打开文件Hypernator.js,将其另存为字符串并将该字符串附加到我的页面中