Jquery 设置 iframe src属性

阅读 34

2023-10-09


 

var ss= "http://www.baidu.com?n="+ Math.random();
$("#hardIframe").attr("src",ss);
$('#hardIframe').attr('src', $('#hardIframe').attr('src'));

function refWin(){
	$.ajax({
		type : 'POST',
		url : $.test.contextPath
				+ "/demoAction.do?method=getMonUrl",
		dataType: 'json',
		success : function(data) {
			if($.test.isNotEmpty(data.error)){
				$.messager.alert('[堤示]', "系统异常!", 'error');
				return;
			}
			var sr= data.url+"?n="+ Math.random();
			$("#hardIframe").attr("src",sr);
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
		}
	});
}

 

精彩评论(0)

0 0 举报