Solved

how can i set the src property of iframe using javascirpt

Posted on 2007-03-19
5
1,216 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Where is this content coming from? 4 40
Error Handler 8 42
display data from multiple ajax calls 9 41
Add Promise to Existing Code 6 30
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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

734 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