Solved

how can i set the src property of iframe using javascirpt

Posted on 2007-03-19
5
1,206 Views
Last Modified: 2008-01-09
I have asp.net 1.1 web form and in that i am using Iframe
now i want to set src property of Iframe using javascript
so wht i want is when user clicks on a button then i want to call this javascript function which i will set src property of the page and then user can see the page in iframe
so how can i set the src property of iframe using javascirpt
0
Comment
Question by:ziorrinfotech
5 Comments
 
LVL 17

Expert Comment

by:HuyBD
ID: 18754097
try

parent.nameofiframe.window.location.href="";

HuyBD;
0
 

Author Comment

by:ziorrinfotech
ID: 18754165
hi HuyBD
it does not work
0
 
LVL 30

Accepted Solution

by:
third earned 50 total points
ID: 18754214
try,

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<iframe name="myframe" src="" width="100%" height=""></iframe>
<form name="frm1" method="post" action="" onsubmit="return ">
<input type="text" name="txt1" value="http://www.google.com">
<input type="button" value="Go" onclick="document.frames['myframe'].location=this.form.txt1.value;">
</form>
</body>
</html>
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18754576
window.frames, third...
0
 
LVL 30

Expert Comment

by:third
ID: 18754721
yes, you are right. why did I do that? ;-) getting rusty everytime I handle another language...
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now