0

Lets say I have a function like this:

<script type="text/javascript">

function ReturnURL()
{
var url = document.URL;
var url2 = url.split("=");
var urlID = url2[url2.length-1];


//window.open('http://localhost/POSkill/skillshow.aspx?user_id =' + urlID);
return urlID;
}

</script>

And I also have iframe in my html file which is something like below:

<iframe id="showSkill" scrolling="yes" src="http://localhost/POSkill/skillshow.aspx?user_id = ReturnURL()" height="350" runat="server" ></iframe>

Now all I want to do is to send the urlID value of javasrcipt as the user_id value in iframe. I have tried by using user_id = ReturnURL() but its not working.

How can I do this?

Thanks in Advance.

Johnny
  • 1,555
  • 3
  • 14
  • 23

1 Answers1

0

I answered something very similar at enter link description here

The answer is that you must set the "src" value on the JS rendering.

This means that somewhere in your javascript you should have the following code

...
document.getElementById("showSkill").src="http://localhost/POSkill/skillshow.aspx?user_id =" +  ReturnURL()
...

This should work just fine.

Community
  • 1
  • 1
guy mograbi
  • 27,391
  • 16
  • 83
  • 122