0
<script type="text/javascript" src="prototype.js"></script>
<script language="javascript">
function hover()
{

		
		new Ajax.Updater('dataLayer', 'ajax_hover1.html', 
		{ 
			method: 'get', 
			evalScripts: true,
			onComplete: function(){
				document.getElementById('dataLayer').style.display='inline';
			}
		});
}
</script>

<a href="#" onclick="hover()">show</a>
<div id="dataLayer" style="display:none; position:absolute;"></div>

ajax_hover1.html contains

<script language="javascript" type="text/javascript">
document.write("testing");
</script>

When i execute, new window is opening.

Please help me. Actually i am using jsp files instead of html. In both cases i am getting same out put


Thanks in advance

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by guillem_bcn
0

Hi ejr74,

I tried to run the code and its working here no window is opening.
what actually the problem is?
Rahul

0

i've got the same problem.
i use prototype updater, sending the form (via post), the php to be run, and the div into which results have to be shown.
but my php contains some javascript that uses document.write, so it opens in a new window. better said, the contents of my page dissapear, and only the written javascript shows in a blank page. evaluated (using 'evalscripts: true' in updater), but in a new page.
how can i insert that javascript and evaluate it INSIDE the destination div???
any help will be appreciated, as i'm driving mad with this!
thanks in advance.
guillem

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.