Javascript 使用jAlerts动态更改按钮文本
我在做一项相对简单的任务时遇到困难。我正在使用jAlerts(),我知道它不再受支持,并试图将按钮的文本更改为变量 现在,这里是jAlerts的开始代码,其中按钮定义为字符串:Javascript 使用jAlerts动态更改按钮文本,javascript,jquery,alert,Javascript,Jquery,Alert,我在做一项相对简单的任务时遇到困难。我正在使用jAlerts(),我知道它不再受支持,并试图将按钮的文本更改为变量 现在,这里是jAlerts的开始代码,其中按钮定义为字符串: $.alerts = { // These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time verticalOffset: -75,
$.alerts = {
// These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time
verticalOffset: -75, // vertical offset of the dialog from center screen, in pixels
horizontalOffset: 0, // horizontal offset of the dialog from center screen, in pixels/
repositionOnResize: true, // re-centers the dialog on window resize
overlayOpacity: .01, // transparency level of overlay
overlayColor: '#FFF', // base color of overlay
draggable: true, // make the dialogs draggable (requires UI Draggables plugin)
okButton: 'Ok', // text for the OK button
cancelButton: 'Cancel', // text for the Cancel button
deleteButton: 'Delete', // text for the remove button
dialogClass: null, // if specified, this class will be applied to all dialogs
我试图用变量替换这些变量(在本例中,我使用的是一个大型JS数组):
我在页面顶部看到,它说可以通过访问脚本中的$.alerts.propertyName来更改这些属性--问题是,似乎没有任何文档说明如何实际执行此操作
jAlert忍者能帮我吗?你完全按照上面说的做——“在脚本中访问$.alerts.propertyName” 要更改“确定”按钮上的文本,请执行以下操作:
$.alerts.okButton = 'string literal or variable here';
要更改“取消”按钮上的文本,请执行以下操作:
$.alerts.cancelButton = 'string literal or variable here';
您完全按照上面所说的操作——“在脚本中访问$.alerts.propertyName” 要更改“确定”按钮上的文本,请执行以下操作:
$.alerts.okButton = 'string literal or variable here';
要更改“取消”按钮上的文本,请执行以下操作:
$.alerts.cancelButton = 'string literal or variable here';
谢谢你的帮助!我只是遇到了麻烦,没有看到一个具体的例子。谢谢你的帮助!我只是遇到了麻烦,没有看到具体的例子。