From first glance this seems perfectly fine. But it has a bug I want to fix.
How do I make the search engine result not to activate the popup blocker? The function works perfectly except that each time somebody clicks the search button to open the result in a separate tab window, they need to tell the popup blocker of the browser that it is okay.
If the page with the codes is not in a iframe it works as it should, but when it is in a iframe it activates the popup blocker on the browser. So how do I make it not to activate the popup blocker alert or to ignore the popup blocker allert in the browser regardless in what browser it is used?
JavaScript:
<script language="JavaScript">
function handleKeyPress(e)
{
var key=e.keyCode || e.which;
if (key==13){
event.preventDefault();
GoToURL();
}
return false;
}
function GoToURL()
{
var URLis;
Advance = document.URLframe.Adv.value
URLis = document.URLframe.u.value
BegEnd = document.URLframe.begnd.value
Word1 = document.URLframe.wo1.value
Code = document.URLframe.co.value
Word2 = document.URLframe.wo2.value
Lang = document.URLframe.lr.value
Country = document.URLframe.cr.value
{
var location= ("https://duckduckgo.com/?q=" + Advance + URLis + BegEnd + Word1 + Code + Word2 + BegEnd + Lang + Country + "&ia=definition");
window.open(location, '_blank');
}
}
</script>
HTML:
<input type="text" name="u" size="71" value="" placeholder=" Type your Search Text here and click »» Search «« ... " id="SeekBox" onkeypress="handleKeyPress(event)">
<input type="button" id="SeekButton" onclick="GoToURL(this)" onkeypress="handle(event)" value=" »» Search «« ">