使用jQuery modal.load传递参数并在javascript请求中获取参数
一个大问题 我正在使用jquery加载一个模式(html)。在加载的请求的html中,Im无法访问变量(window.location.href带来主url,document.location不带来参数,等等) 有人知道怎么解决吗 js loadmodal:使用jQuery modal.load传递参数并在javascript请求中获取参数,javascript,html,jquery,bootstrap-modal,Javascript,Html,Jquery,Bootstrap Modal,一个大问题 我正在使用jquery加载一个模式(html)。在加载的请求的html中,Im无法访问变量(window.location.href带来主url,document.location不带来参数,等等) 有人知道怎么解决吗 js loadmodal: var url = '/user/profile.html' var data = { "dynamicField" : "id", "dynamicFieldValue"
var url = '/user/profile.html'
var data = {
"dynamicField" : "id",
"dynamicFieldValue" : $('#hash').val()
};
$('#main').find('.modal-body').load( url, data, function(){
$('#main').modal( { show : true } );
});
“user/profile.html”js:
$(document).ready(function(){
var dynamicField = ?????????? (i need get the parameter "dynamicField");
var dynamicFieldValue = ?????????? (i need get the parameter "dynamicFieldValue");
});