I am trying to develop a very small system using asp.net iframes.i have developed a page saying search.aspx and have used iframes in this to show Google, yahoo, Cuil, Bing etc on button click like this code
<pre lang="xml"><html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link href="searchstyle.css" rel="stylesheet" type="text/css" />
<title>Search Domain</title>
<meta name="description" content="">
</head>
<body>
<div align="center" style="font-size: x-small; font-family: arial, helvetica, sans-serif">
<form name="jumpy">
<select name="example" size="1" onChange="gone()">
<option value="http://www.yahoo.com" selected>Yahoo.com</option>
<option value="http://www.google.com">Google.com</option>
<option value="http://www.news.com">News.com</option>
<option value="http://www.altavista.com">AltaVista.com</option>
<option value="http://www.gmail.com">Gmail.com</option>
<option value="http://www.nasa.gov">Nasa.gov</option>
<option value="http://www.rediffmail.com">rediffmail.com</option>
<option value="http://www.customise.com">Customise</option>
</select>
<input type="button" name="test" value="Go!" onClick="gone()"/>
<input type="Text" name="customise" disabled="disabled" title="Enter Ur Search Url"/>
<input type="button" name="test1" value="Get!" onClick="go()" disabled="disabled"/>
</form>
<script language="javascript" type="text/javascript">
<!--
var displaymode=0
var iframecode='<iframe id="external" style="width:100%;height:100%" src="http://www.yahoo.com"></iframe>'
if (displaymode==0)
document.write(iframecode)
function gone()
{
var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
if( selectedurl == 'http://www.customise.com')
{
document.jumpy.example.disabled = true
document.jumpy.test.disabled = true
document.jumpy.customise.disabled = false
document.jumpy.test1.disabled = false
}
else
{
if (document.getElementById&&displaymode==0)
document.getElementById("external").src=selectedurl
else if (document.all&&displaymode==0)
document.all.external.src=selectedurl
else{
if (!window.win2||win2.closed)
win2=window.open(selectedurl)
else{
win2.location=selectedurl
win2.focus()
}
}
}
}
function go()
{
var selectedurl=document.jumpy.customise.value
if (document.getElementById&&displaymode==0)
document.getElementById("external").src=selectedurl
else if (document.all&&displaymode==0)
document.all.external.src=selectedurl
else{
if (!window.win2||win2.closed)
win2=window.open(selectedurl)
else{
win2.location=selectedurl
win2.focus()
}
}
}
</script>
</div>
</body>
</html>
<pre lang="HTML">
but the problem is that i want to insert these scripts
<script type="text/javascript">
document.oncontextmenu=new Function("return false");
</script>
and
<script type="text/javascript" src="www.xyz-abc.co.in/js/..../me.js">
</script>
after iframe load the contents, this javascript should merge into the loading contents and should run in the page being loaded. could any one can suggest me. i have checked it using jquery but no results.
in other words i want to run a script file inside the iframe each and evry time new contents are loaded to iframe.