Solved

how can i set the src property of iframe using javascirpt

Posted on 2007-03-19
5
1,218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
Suggested Courses

628 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