関数を呼び出して、親からiframejavascript関数にパラメーターを渡そうとしています。
私は持っています
document.getElementById('iframeD').contentWindow.detect(name);
私の親のJavaScriptで
私のiframeで..私が持っている場合
function detect(name){
console.log(name);
}
それは私に与えます
Uncaught SyntaxError: Unexpected token name
ただし、パラメータなしで関数を呼び出すだけの場合
document.getElementById('iframeD').contentWindow.detect();
iframeを機能させる
function detect(){
console.log('I want to pass the pare');
}
それは動作します。
これを解決するにはどうすればよいですか?助けてくれてありがとう!!!