gpt4 book ai didi

javascript - 如何检索 GET 请求内容的 flashvars?

转载 作者:行者123 更新时间:2023-11-30 06:38:18 25 4
gpt4 key购买 nike

我想将自定义按钮添加到特定模型的 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 的全部内容。

最佳答案

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

如果你想要网址:

$('#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.');
});
});

引用资料:

关于javascript - 如何检索 GET 请求内容的 flashvars?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13139886/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com