小编Muj*_*bly的帖子

ie11与嵌套的showModalDialog有关

我正在使用一个Web应用程序,它使用许多模态对话框来获取输入.当我开始使应用程序与IE11兼容时,问题就开始了(它在IE8中运行得非常好).当从主页调用时,模态对话框完美地返回值,但是当我从模态对话框创建模态对话框时,返回值但未被捕获并被视为undefined.

//calling the values
var ret = ShowDialogOpen(pageUrl, width, height);

function ShowDialogOpen(PageName, strWidth, strHeight) {
    var DialogOptions = "Center=Yes; Scrollbar=No; dialogWidth=" + strWidth + ";          dialogTop=150px; dialogHeight=" + strHeight + "; Help=No; Status=No; Resizable=Yes;";
    var OpenUrl = PageName; 
    var ret = window.showModalDialog(OpenUrl, "Yes", DialogOptions);
		    
    return ret;
}

//Dialog returning values
function ReturnValues() {
    var lstBox = document.getElementById("lst_Name");
    var texts = "";
    var values = "";
    for (i=0; i<lstBox.options.length; i++) {
        texts = texts + lstBox.options[i].text + "!";
        values …
Run Code Online (Sandbox Code Playgroud)

javascript nested showmodaldialog internet-explorer-8 internet-explorer-11

10
推荐指数
1
解决办法
5322
查看次数

动态地将事件附加到输入

我正在ng5中创建一个表单生成器.基本上,我发送它JSON,它生成表单.

我需要一种方法将事件动态地附加到FormControl.我将以下JSON传递给它:

{
  events: {
     click: 'functionNameHere',
     dblclick: 'functionNameHere',
     so on ....
  }
}
Run Code Online (Sandbox Code Playgroud)

如何将此处传递的任何事件附加到我的控件?

angular

5
推荐指数
1
解决办法
1794
查看次数

这些单选按钮中的训练逗号来自哪里?

由于某些原因,选项末尾有一个逗号。它不在模板中,我不确定它来自哪里。

起初我以为这是某个脚本,但即使在隔离后问题似乎仍然存在。

const options = [
        "Easy to use",
        "Loading",
        "Fast",
        "Others (Mention below)"
      ];
      const template = `
    <div class="question-title">sdjhaskjdhakjs</div>
    <div class="question-options">${options?.map((option, i) => {
      return `
      <div class="question-option">
        <input class="${"id"}-feedback-question-option" type="radio" id="${"id"}-${option}" name="option" value="${option}" ${
        options.length === i - 1 ? "checked" : ""
      } />
        <label for="${"id"}-${option}">${option}</label>
      </div>`;
    })}</div>
  `;
 
 document.getElementById("app").innerHTML = template;
Run Code Online (Sandbox Code Playgroud)
.question-title {
      position: relative;
      height: 40px;      
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: normal;
      font-size: 16px;
    }

    .question-options {
      position: relative;
      display: flex;
      align-items: …
Run Code Online (Sandbox Code Playgroud)

html javascript css

1
推荐指数
1
解决办法
45
查看次数