简体   繁体   English

来自外部JavaScript文件的呼叫ID

[英]Call ID from external javascript file

I'm building a TinyMCE custom dropdown menu in WordPress. 我正在WordPress中构建TinyMCE自定义下拉菜单。 I am able to call a form into the thickbox modal window if I include the form in the same javascript file as the dropdown menu, but I want to be able to call a form from an external javascript file. 如果我将表单包含在与下拉菜单相同的javascript文件中,则可以在thickbox模态窗口中调用表单,但是我希望能够从外部javascript文件调用表单。 Here's the code that allows me to call it inline: 这是允许我内联调用的代码:

b.add({
title:"MyLink","class":"tmce-mylink",onclick:function(){
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width; 
W = W - 80; 
H = H - 80; 
tb_show( 'MyLink', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=mylink-form' );
}
}
);

The key component there is this line: 关键部分是这一行:

tb_show( 'MyLink', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=mylink-form' 

How can I modify this to call the form id from an external JS file into the TB modal? 我该如何修改以将外部JS文件中的表单ID调用到TB模式中?

我发现只要注册表格,我就可以在任何地方调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM