我有个页面弹窗,是在 `index.html` 页面加载的 js 代码里通过 jquery get 方法实现的,大概代码如下: $.get('./addOrEdit.html?id=100', function (data) { var info = data, oppoBox = $('#oppoBox'), title = $.trim(obj.attr('atitle')); if (info.length) { $('#oppoInfo').html(info); $('#oppoBg').css({'height': $(document).outerHeight() + 'px'}); oppoBox.css({'width': $(document).outerWidth() * 11 / 18 + 'px'}); var top = $(window).height() / 18, height = $(window).height() - top * 2; oppoBox.css({ 'left': ($(document).outerWidth() - oppoBox.outerWidth()) / 2 + 'px', 'top': top + 'px', 'height': height + 'px', 'overflow': 'hidden' }); $('#oppoTitle').text(title); $('#oppoInfo').css({ 'height': height - parseInt($('#toolBar').css('lineHeight')) - parseInt($('#oppoInfo').css('paddingTop')) - parseInt($('#oppoInfo').css('paddingBottom')) + 'px' }); $('#oppoBg,#oppoBox').removeClass('hide'); } }); 现在我期望是在 `addOrEdit.html?id=100` 页面加载的 js 文件获取到当前的 `id` 的参数值,但是现在获取到的当前页面地址一直是 `index.html`,请问大神这个该怎么办?小弟跪谢。 请大佬不要告诉直接写死 `100` 就行了,我这里为了方便看直接写成了 `addOrEdit.html?id=100`,实际的页面这个 `url` 是个变量表示的。