2017-09-28 9 views
3

現在、ユーザーが値を入力してlPARAMをWM_TCARDに送信するボタンを生成するCHMヘルプファイルを作成しようとしています。Javascript Onclickイベントを使用してActiveX Template Coach(TCard)オブジェクトを作成しようとしています

現在、私はIE Explorer 11、10、9 & 8でテストしましたが、オブジェクトが正しいパラメータで作成されていますが、正しく表示されず、ボタンとして表示されません。

<body> 
<button onclick="create_object();">Try it</button> 
<input type="text" id="layout_enter" /> 
<button id=click_button99 onclick="click_new_object();">click</button> 
<script> 

function create_object() { 

    var new_obj = document.createElement("OBJECT"); 
    new_obj.setAttribute("classid", "clsid:41B23C28-488E-4E5C-ACE2-BB0BBABE99E8"); 
    new_obj.setAttribute("codebase", "HHCTRL.ocx#Version=4,72,8252,0"); 
    new_obj.setAttribute("type", "application/x-oleobject"); 
    new_obj.setAttribute("id", "object99"); 
    document.body.appendChild(new_obj); 

    var layout_entered = "10," + 
    document.getElementById('layout_enter').value 

    var z = document.createElement("PARAM"); 
    z.setAttribute("name", "Button"); 
    z.setAttribute("value", "PP Sonic"); 
    document.getElementById("object99").appendChild(z); 

    var y = document.createElement("PARAM"); 
    y.setAttribute("name", "Command"); 
    y.setAttribute("value", "TCard"); 
    document.getElementById("object99").appendChild(y); 

    var x = document.createElement("PARAM"); 
    x.setAttribute("name", "Image"); 
    x.setAttribute("value", " "); 
    document.getElementById("object99").appendChild(x); 

    var w = document.createElement("PARAM"); 
    w.setAttribute("name", "Item1"); 
    w.setAttribute("value", layout_entered); 
    document.getElementById("object99").appendChild(w); 

    var v = document.createElement("PARAM"); 
    v.setAttribute("name", "UseButton"); 
    v.setAttribute("value", "TRUE"); 
    document.getElementById("object99").appendChild(v); 

    var u = document.createElement("PARAM"); 
    u.setAttribute("name", "UseIcon"); 
    u.setAttribute("value", "TRUE"); 
    document.getElementById("object99").appendChild(u); 
} 

function click_new_object() { 
    document.getElementById("object99").click(); 
} 
</script> 
</body> 

助けてください/アドバイスをいただければ幸いです。 私は既に何も解決しなかったActiveXのインターネットオプションのセキュリティオプションを見てきました。コードにオブジェクトが存在していたら、それが表示されます。私はそれがオブジェクトとの問題ではなく、創造であると私に考えさせる。

注意:私はJQueryを使用できません。

ありがとうございます。

答えて

1

私が知っている限り、これはセキュリティアップデートによって壊れていました。

2004-2005の間、Windowsは常に攻撃を受けていました。多くのセキュリティホールを埋めるために、MSはHTMLヘルプの機能をローカルヘルプの機能に限定することにしました。

Workshopヘルプでは、以下のリモート機能について説明していますが、Windows XP以降では実際には機能しません。

  • HTMLヘルプActiveXコントロール HHビューアのメインヘルプコードライブラリ(実行可能ファイル)は、hhctrl.ocxに格納されています。これは、いくつかのActiveX機能を備えたDLLです。セキュリティ更新の前に、このコントロールを使用して目次と索引をWebページに埋め込むことができました。
  • HTMLヘルプJavaアプレット Webページにナビゲーション(目次/索引)を埋め込む代わりに、Sun Javaを使用しました。 Microsoftによって維持されたことはなく、使用できない状態に陥っています(セキュリティ更新プログラムが壊れている前でも)。したがって、この機能を無視してください。

私は何年も前のショートカットリンクに従ってみました。欠品ボタンの交換として? - 私は確信しています!これは、圧縮されたCHMファイルでのみ機能することに注意してください。

<html> 
<head> 
<title>Using CHM shortcut links</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<meta name="keywords" content="Shortcut, Link" /> 
<meta name="MS-HKWD" content="Shortcut" /> 
<meta name="MS-HKWD" content="Link" /> 
<link href="../design.css" rel="stylesheet" type="text/css" /> 

<OBJECT id=MyUniqueID type="application/x-oleobject" 
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> 
    <PARAM name="Command" value="ShortCut"> 
    <PARAM name="Item1" value=",http://www.help-info.de/index.htm,"> 
    <PARAM name="Item2" value=",,"> 
    <!-- second item parameter seems to be required when downloaded from web with "Open/Save Dialog" --> 
</OBJECT> 

</head> 

<body> 

<h1>Using CHM shortcut links</h1> 
<p>This is a simple example how to use shortcut links from a CHM file and jump 
    to a URL with the users default browser.</p> 
<p>Example:</p> 
<p><a href="javascript:MyUniqueID.Click()">Click me to go to www-help-info.de</a></p> 

</body> 
</html> 
関連する問題