<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

Recommended Answers

All 2 Replies

Hi ejr74,

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.