Stack Exchange
iframe src is not called; though the url is prepared
I have an iframe and the jQuery ready function creates the Url.  But iframe is not loading the src.  Please help.
<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>


Any JS error appeared ?

No errors.  It goes into the transform url; creates url. Also it goes into iframe_Load(this) without errors.

If I write the same content of transformUrl into jQuery.ready(function() it is working fine.  But I want to use the .js file that i have created

Is the transformed URL malformed (e.g. contains special characters ) ?

try an alert('src: '+jQuery('#resize').attr('src')) after and see what it displays.

or you could do something like jQuery('#resize').load(function() { alert('url loaded'); });

I don't know; but I have returned source (the transformed url) back to the call and it worked.  in ready function var source = sb.util.transformUrl();  jQuery('#resize').attr('src', source);

@ShivanRaptor no malformed characters.
