我有一个iframe,jQuery ready函数创建了Url。但是iframe没有加载src。请帮忙。
<sbFrame.js file>
sb.util.transformUrl = function(){
try
{
var category = document.getElementById('id').value,
zip = document.getElementById('zip').value,
src = jQuery('#resize').attr('src');
var source = src + '?catOid=' + category
+ '&zip='
+ zip;
console.log(source); //URL transformed.
jQuery('#resize').attr('src', source);
}
catch (e) {
alert('exception: ' + e);
}
};
jQuery(document).ready(function(){
sb.util.transformUrl();
});
<div id="container">
<iframe id="resize" scrolling="NO" style="padding:0; width:626px;" frameborder="0"
src="/details/results" onload="Iframe_Load(this)" />
</div>