我使用的是jquery tools覆盖插件。在overlay中,我加载了一个特定的url。将url加载到overlay中后,如何从jquery获取此url?
更新:
我的代码看起来像jquery overlay open external link example
我想知道url的原因是因为我在那里设置了一些参数,我正在尝试访问。
发布于 2011-09-07 20:05:21
使用基本代码:
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("a[rel]").overlay({
mask: 'darkred',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
// save the currently-loaded URL as a data field on the wrapper
wrap.data('currenturl',this.getTrigger().attr("href"));
}
});然后,获取URL所需的全部内容如下:
$(".contentWrap").data('currenturl');https://stackoverflow.com/questions/7333290
复制相似问题