0

I have an iframe with a jsbin url. When I edit the jsbin, is there any possible way to obtain the upgraded url, without taking it from the jsbin interface.

For example,

I have my iframe with jsbin. I work some stuff on it, and the url of the jsbin changes in order to save my work. How with javascript can I retrieve the upgraded url?

------HTML

<div><iframe id="myframe" class='iframeSize'  src="www.jsbin.com/fafda/1/edit" ></iframe></div>;

------javascript

var updatedLInk = $("#myframe").attr("src");

When I edit the jsbin the link changes because it stores information, however, when I want to retrieve the updatedLInk, I only get the original link like www.jsbin.com/fafda/1/edit instead of www.jsbin.com/fafda/8/edit

Abe
  • 757
  • 6
  • 15
  • you need to be more clear.Give some code samples.Or upload a screenshot (like in Imgur) and share it in your question. – Zword Nov 24 '13 at 07:44

1 Answers1

1

You could use <iframe id="myframe" class='iframeSize' src="www.jsbin.com/fafda/latest" >

in order to always display the latest version of your jsbin.

Also if at any time you need to figure out the url you can request the latest url i.e. www.jsbin.com/fafda/latest from your server side code (to avoid cross domain issues from client side js) and read the last location redirected.

melc
  • 11,523
  • 3
  • 36
  • 41