You are viewing limited content. For full access, please sign in.

Question

Question

Introducing a delay before running custom HTML

asked on December 26, 2014

Hello guys! I've been trying to pull docs from Weblink into an iframe and have been successful in doing so as long as i manually type in the contract number (q1) that gets looked up from a table and retrieves a link that then gets put into a field (q3), then uses that to  populate that iframe(q4).

What i want to be able to do is pass a value through the URL so you dont have to manually type in the value for the look-up. Whenever i do that the iframe never gets populated with the image.

Any ideas?

$(document).ready(function() {
  setTimeout(function() {},5000);
  $('#q3 input').change(function() { 	
  var Link = $('#q3 input').val() 		
  $('#q4 iframe').attr('src',Link);  	
  });
});

Thanks!

0 0

Replies

replied on December 26, 2014

Just to make sure, I noticed in your original code that you do not have a terminator at the end of

var Link = $('#q3 input').val()

Should be

var Link = $('#q3 input').val();

 

1 0
replied on December 26, 2014

Instead of

$('#q4 iframe').attr('src',Link);

Try

$('#q4 iframe')[0].src = Link;

 

0 0
replied on December 26, 2014

That completely breaks it, even if i type the value in manually it doesn't show up.

0 0
replied on December 26, 2014

Sorry i lied, Weblink can be a bear sometimes. It works if i type it in manually but nothing comes up if i pass the value through the URL.

0 0
replied on December 27, 2014 Show version history

Hey there,

Also, if the delay isn't working, put the code inside the setTimeout() function, like this:

$(document).ready(function() {
  $('#q3 input').change(function() {    
    setTimeout(function() {
      var Link = $('#q3 input').val();       
      $('#q4 iframe').attr('src',Link);     
    },5000);
  });
});

 

0 0
replied on December 29, 2014

The same result of working manually but not being passed through the URL.

If someone has any work around ideas, please let me know!

 

Thank you guys for your help so far! 

 

0 0
replied on January 4, 2015

Passing value in URL works well for me if I load an image from laserfiche.com with your code.  Can you check that scr attribute for the iframe has value when you find the image is not loaded in the iframe in order to figure out it is caused by delay of the script or too slow to load the Weblink document.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.