有没有办法在文本区域中突出显示部分文本?
说,文字是Hi @twitter @twitpic,现在我想强调@twitter和@twitpic,而不是喜.那可能吗?
这必须在飞行中发生.
PS:我不想使用iFrame
提前致谢
我正在开发一个MVC5 Web应用程序.该应用程序有2个区域,'SU'和''App'.每个区域都应独立进行身份验证.每个区域也有自己的登录页面.
我正在使用OWIN来验证用户身份.
现在的问题是,我无法CookieAuthenticationOptions LoginPath根据用户请求的区域设置owin .
例如,如果用户请求http://example.com/su/reports/dashboard,我应该能够将它们重定向到http://example.com/su/auth/login
同样的,对于'App'区域,如果用户请求http://example.com/app/history/dashboard,我应该能够将它们重定向到http://example.com/app/auth/login
我想避免自定义属性,因此尝试下面的代码,但它总是重定向到root登录路径,即, http://example.com/auth/login
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
var url = HttpContext.Current.Request.Url.AbsoluteUri;
string loginPath = "/auth/login";
string areaName = string.Empty;
if (url.ToLower().Contains("/su/"))
{
areaName = "SU";
loginPath = "/su/auth/login";
}
if (url.ToLower().Contains("/app/"))
{
areaName = "APP";
loginPath = "/app/auth/login";
}
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "ApplicationCookie" + areaName,
LoginPath = new PathString(loginPath)
});
}
}
Run Code Online (Sandbox Code Playgroud)
我是否遵循正确的方法或是否有其他方法来实现相同的目标?谢谢!
有没有一种方法可以使文本contenteditable div从开始到光标位置。
例如:
<div id="editableDiv" contenteditable="true">
the quick brown fox jumps over a lazy dog.
</div>
Run Code Online (Sandbox Code Playgroud)
假设1:光标在单词quick之后闪烁。对函数的查询必须返回快速
假设2:光标在句子的末尾闪烁。该函数的查询必须返回快速的棕色狐狸跳过一条懒狗。
我有一个div "editableDiv",它嵌套在另一个div中.editableDiv有一个无序列表作为其子项.请仔细阅读代码
<div>
<div id="editableDiv" contenteditable="true">
<ul id="suggestUL"></ul>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
问题是,如何找到最里面的ul suggestUL
提前致谢.