Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Redirection in a DIV

Posted on 2006-07-17
5
Medium Priority
?
278 Views
Last Modified: 2008-02-26
Hello,
In the following code I am trying to change the innerHTML of the div dynamically when pressed the button.
I want to make this div with this inner HTML redirected to another page.

With the foolowing script it redirects just after I view the page.

Do you have a solution for that?

<html>
<head>
</head>
<script language="javascript">
 function do_ee()
{
     document.getElementById('ee').innerHTML='<html><% Response.Redirect("moduller.asp") %></html>'
}
</script>
<div id="ee">
aaaa
</div>

<input type = "button" onclick = do_ee()>

</html>
0
Comment
Question by:edoyuk
[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
  • 2
  • 2
5 Comments
 
LVL 17

Expert Comment

by:gops1
ID: 17121003
What exactly has to be done, should the page get redirected or change to content of the DIV

I guess with innerHTML you can do a write/Edit/Delete contents but not perform an action of redirecting
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 17121073
Here an example:
<html>
<head>
<title>Zvonko &#42;</title>
<script>
 function do_ee(){
     window.frames.ee.location='http://experts-exchange.com'
     document.getElementById('eeFrame').style.display='block';
     document.getElementById('eeDiv').style.display='none';
}
</script>
</head>
<body>
<iframe name="ee" id="eeFrame" style="display:none;"></iframe>
<div id='eeDiv'>
aaaa
</div>
<form>
<input type="button" value="EE" onclick="do_ee()">
</form>
</body>
</html>

0
 

Author Comment

by:edoyuk
ID: 17121110
Zvonko,
Actually I am looking for a solution without using any frame or iframe.

Do you know a solution like that?

Thanks.
0
 
LVL 17

Accepted Solution

by:
gops1 earned 2000 total points
ID: 17121133
Are you trying to get the contents of "moduller.asp" inside the DIV??

Then you can get it done either using AJAX thats one way
Other way is get the contents of moduller.asp inside the div and keep it hidden and show it when required
0
 

Author Comment

by:edoyuk
ID: 17121341
AJAX solved my problem.
Thanks gops1
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…

647 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