Link to home
Start Free TrialLog in
Avatar of edoyuk
edoyuk

asked on

Redirection in a DIV

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>
Avatar of gops1
gops1
Flag of United States of America image

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
Avatar of Zvonko
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>

Avatar of edoyuk
edoyuk

ASKER

Zvonko,
Actually I am looking for a solution without using any frame or iframe.

Do you know a solution like that?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of gops1
gops1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of edoyuk

ASKER

AJAX solved my problem.
Thanks gops1