我有一个返回搜索结果的Ajax请求,我正在动态创建DOM元素来显示这些结果.除了IE8之外,我在所有测试的浏览器中都按预期工作.
请求返回正常,JavaScript正在成功运行,并且正在创建元素,但元素未显示在页面中.它们仅在鼠标单击页面上的某个位置后出现.
我运行了一个快速测试,运行没有Ajax请求的回调代码,并且它在那里表现得如预期的那样.所以我想知道这是否与IE8管理回调线程的方式有关.有没有其他人看到过这样的行为,或者对此有所了解?
回调基本上非常简单.我转载了这个:
function catchResults(response) {
var contentBlock = document.getElementById('divResults');
var divResults = document.createElement('div');
var txt = document.createTextNode("Results");
divResults.appendChild(txt);
contentBlock.appendChild(divResults);
}
Run Code Online (Sandbox Code Playgroud)
我正在使用JQuery.ajax进行调用.我在FireFox和Chrome中看到了正确的行为.
谢谢您的帮助!
我是OpenID和Angular的新手,我正在尝试使用该angular-auth-oidc-client软件包.达米恩博德和 埃兰德森有一些很好的例子,但我似乎无法摆脱起跑线.
安装软件包之后,我所要做的就是注入OidcSecurityService- 我甚至不必使用它 - 我收到运行时错误:
StaticInjectorError(AppModule)[OidcSecurityService -> OidcDataService]:
StaticInjectorError(Platform: core)[OidcSecurityService -> OidcDataService]:
NullInjectorError: No provider for OidcDataService!
...
Run Code Online (Sandbox Code Playgroud)
我的自然想法是导入OidcDataService并将其添加到提供程序,但这会导致编译器错误:
ERROR in src/app/app.module.ts(3,31): error TS2305:
Module '"<...>/auth-test/node_modules/angular-auth-oidc-client/index"'
has no exported member 'OidcDataService'.
Run Code Online (Sandbox Code Playgroud)
我的谷歌已发现任何看起来没有相关性的内容,并且它在整合软件包的过程中如此早地阻塞,我必须在某处如何将所有内容链接在一起做出错误的假设.谁能看到它?
我可以用最小的项目重现.使用以下步骤创建项目:
ng new auth-test
npm install angular-auth-oidc-client --save
Run Code Online (Sandbox Code Playgroud)
然后添加Oidc服务,使其app.module.ts如下所示:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { OidcSecurityService } from 'angular-auth-oidc-client';
import { AppComponent } from './app.component';
@NgModule({
declarations: …Run Code Online (Sandbox Code Playgroud)