我在做一个相对简单的任务时遇到了麻烦。我正在使用 jAlerts ( http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/ ),我知道它不再受支持,并尝试将按钮的文本更改为一个变量。
到目前为止,这里是 jAlerts 的开始代码,其中按钮被定义为字符串:
$.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 = {
// 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: property_dict['allDialog.OK.button.text'], // text for the OK button
cancelButton: property_dict['grid.Confirm.Delete.cancel'], // text for the Cancel button
deleteButton: property_dict['grid.Confirm.Delete.remove'], // text for the remove button
dialogClass: null, // if specified, this class will be applied to all dialogs
我在页面顶部看到,它说可以通过访问脚本中的 $.alerts.propertyName 来更改这些属性——问题是,似乎没有任何文档说明如何实际执行此操作。
那里有任何 jAlert 忍者可以帮助我吗:?