問題タブ [html5-template]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - HTML を含めるにはどうすればよいですか element within a Meteor Blaze Template?
I'm using Meteor, but would like to use some vanilla javascript/HTML code that uses the html template element.
I'm using Meteor, but would like to use some vanilla javascript/HTML code that uses the html template element.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template
When I try to include one inside a meteor template:
Meteor displays the following error:
Is there a way to include these in a Meteor template? I am aware I can include them within the body tag but its a bit unwieldy.
Hide simulink model window
In my project I use MATLAB's function sim
in a loop.
At the first call for the sim function, a Simulink model window gets open.
Is there a possibilities to make this window hidden? As this set(f,'Visible','off');
works for plots.
I'm using Meteor, but would like to use some vanilla javascript/HTML code that uses the html template element.
I'm using Meteor, but would like to use some vanilla javascript/HTML code that uses the html template element. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template When I try to include one inside a meteor template: Meteor displays the following error: Is there a way to include these in a Meteor template? I am aware I can include them within the body tag but its a bit unwieldy.
In my project I use MATLAB's function sim
in a loop.
At the first call for the sim function, a Simulink model window gets open.
Is there a possibilities to make this window hidden? As this set(f,'Visible','off');
works for plots.
javascript - テンプレートタグへのコンテンツの追加
テンプレートタグにコンテンツを追加しようとしています。私は使っている
getcontent は response を返す ajax 呼び出しです。応答は解析され、オブジェクトとして obj 変数に格納されます。
createFullList は、ajax 応答のすべての要素に対して div を作成し、それを fragment に追加します。次に、フラグメントは、同じく返される div に追加されます。
問題はテンプレートに追加することですが、何もしません。その内容をコピーしようとすると、子が 0 と表示されますが、div の子を印刷すると正しい番号が印刷されます。
コンテンツがテンプレートに追加されないのはなぜですか? これは正しい方法ですか、それともテンプレートにコンテンツを正しく追加する特定の方法はありますか?
javascript - HTML テンプレート要素: 説明
私は最近 HTMLtemplate
要素を発見しました。
私が知る限り、3つの際立った機能は次のとおりです。
template
画面にレンダリングされませんtemplate
DOM に到達しない- とその内容
content
の間の仮想要素として機能する追加のプロパティがあります。template
これらとは別に、 aは、画面と DOM から隠され<template>
ている可能性があります。div
この点で、 を利用するために使用される JavaScripttemplate
は、div
.
問題は、これは正しいですか?私が尋ねる理由:
- 自分の中ではっきりさせればいいだけ
- サポートしていないブラウザ用に偽造するのは比較的簡単です。
ありがとう
javascript - インポートされたスタイルシートをカスタム要素のテンプレート タグ コンテンツに適用する方法は?
これが私が使用しようとしているコードです
ただし、imported stylesheet
dropzone.csstemplate
はタグ内のコンテンツに適用されません。つまり、クラス dropzoneはdropzone.cssdiv
からスタイルを取得しないため、インポートされたファイルのスタイルはタグ内のような要素に適用されませんtemplate
。
このリンク タグをテンプレート タグ内に配置しようとしましたが、それも機能しません。
インポートしたスタイルシートをカスタム要素のテンプレート タグ コンテンツに適用することはできますか?
html - HTML5 テンプレート タグはエッジで機能しませんか?
一部の JavaScript 機能にテンプレート タグを使用する Web サイトを作成しました。そして、この機能はエッジでは機能しません。これは、過去にそれらの間で問題が発生する可能性があると聞いたので、テンプレートタグが原因であると思います。
しかし、caniuse.com によると、edge は template-tag をサポートする必要があり、問題はリストされていません。また、MDN によると: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template Edge はバージョン 13 以降でサポートされているはずです。バージョン 20 の Edge でテストしました。
また、エッジコンソールでjavascriptエラーが発生しないため、テンプレートタグにのみ問題があると想定しています。
私の質問はかなり単純です。Edge は template-tag をサポートしていますか? または、必要な回避策 (shiv など) はありますか?
javascript - Disqus コメントがポリマー カスタム要素で機能しない
カスタム要素内で動作するように disqus コメント コードを作成する方法がわかりません。
私のサイトの構造:
| | index.html
--------\ my-app.html
(カスタム要素)
----------------\ my-testView1.html
(カスタム要素)
---------------- \ my-testView2.html
(カスタム要素)
内部にdisqusコメントを入れる必要がありmy-testView1.html
、my-testView2.html
の構造index.html
:
の構造my-app.html
:
の構造my-testView1.html
:
の構造my-testView2.html
:
Disqus div
disqus コメントの div を の中に入れて、<my-app>
chromeindex.html
が見つけられるようにしました。そのように中に入れると、それを見つけることができませ<my-testView1>
ん:
ページmy-app.html
my-app.html はそれ自体がカスタム要素であり、chrome がそれを見つけられないためです。そのため、シャドウ DOM (index.html
ページ)の外に配置する必要がありました。
ページ上の Javacript コードは次のようにmy-testView1.html
なります。my-testView2.html
結果
コメントは、一度にこれらの 1 つにのみ表示されmy-testView1.html
my-testView2.html
ます。my-testView1.htmlに 1 つの disqus スレッドが必要で、my-testView2.htmlに別の disqus スレッドが必要です
ルーティングのせいかもしれません。Disqus コンソール メッセージには、ajax メソッドを使用する必要があると書かれていますhttps://help.disqus.com/customer/portal/articles/472107-using-disqus-on-ajax-sites上記のコードと例のコード:
両方のカスタム要素の内部(それぞれdisqus_identifier
にdisqus_url
応じて変更)
javascript - appendChild() は、インポートされたテンプレートからコンテンツを取り除きます
<template>
function を使用して HTML5 のアクティブなコピーを取得しimportNode()
ます。
この後、動的データを入力し、
最後に、ノードをターゲット コンテナーに追加します。
私の問題:result
ノードのコンテンツがすべて取り除かれています: 結果ノードのテンプレートのコンポーネント要素にアクセスできません。実際には、操作が実行されると、result
ノードには子ノードがまったく含まれません。appendChild
の戻り値はappendChild
、コンテナに挿入され、現在アクティブなドキュメントの一部となっているノードを指すはずです。これが当てはまらない理由は何ですか?
これがjsfiddleです(Chrome 53でテスト済み):
javascript - 単一のソリューションですべてのブラウザをサポートする必要があるテンプレートタグで要素を見つける方法
テンプレートタグ内でdiv要素を使用すると、jQueryセレクターを介してどのように見つけることができるかを意味します。**
私はdiv要素「id」の中だけを知っています
** 以下の例を確認してください。
更新されたフィドル リンクhttps://jsfiddle.net/vbpradeep/o9LkL3g6/3/