1
这是我的脚本部分的代码。任何一个人都可以引导我如何通过使用url的JavaScript发送数据?
update_selected: function() {
var url = base_url + "event/update_selected_event/" + this.id /+ this.event_id;
window.location.href = url;
}
这是我的脚本部分的代码。任何一个人都可以引导我如何通过使用url的JavaScript发送数据?
update_selected: function() {
var url = base_url + "event/update_selected_event/" + this.id /+ this.event_id;
window.location.href = url;
}
这取决于你的脚本试图做什么。由于您正在使用此线路重定向
window.location.href = url;
我在猜测您想要将信息传递到您将导航到的页面。为此,您可以使用URL参数
var url = base_url
+ "event/update_selected_event"
+ "?id=" + this.id
+ "&event_id=this.event_id";
window.location.href会将您重定向到该URL。你问如何将信息传递给该页面?网址参数会为你做到这一点。 – akronymn
亚..我想发送id和event_id在功能update_selected_event是在事件控制器..所以我如何传递ID和事件ID? – Shadow
明白了 - 回答补充。 – akronymn