2

我想将自定义按钮添加到特定模型的 rails_admin 新/编辑页面。

此按钮应将获取请求的内容解析为自定义 URL。

我使用这样的 JQuery 方法发现的当前问题:

$('#your_button_id').click(function () {
  $.get('your_url', function(data) {
    //$('.result').html(data); - sample
    //Do whatever you want
    alert('Load was performed.');
  });
});

是它不加载 flashvars 属性。

我想知道是否还有其他替代方法可以检索包含 flashvars 的全部内容。

4

1 回答 1

0

我不确定您是否只想获取 URL 或对获取请求的响应,所以:

如果你想要网址:

$('#your_button_id').click(function () {
  var sPageURL = window.location.search.substring(1);
  //manipulate the url in sPageURL
});

如果你想要 url 的内容:

$('#your_button_id').click(function () {
  $.get('your_url', function(data) {
    //$('.result').html(data); - sample
    //Do whatever you want
    alert('Load was performed.');
  });
});

参考:

于 2012-10-30T15:48:59.107 回答