Page 1 of 1
Java script
Posted: Thu Jan 29, 2004 5:27 am
by pinehead18
I have a javascript script wich opens another window when i click on a link. HOwever this script requies the browser to also re-load the page the script was one. So when i use it on my search function it looses its search vars and resets the search.
Is their anyway to write this script without it requring the re-fresh of the page the link is one. Does anybody have any examples of this code (i am not a java script coder but it was the only script i managed to find)
Thank you
Anthony
Posted: Thu Jan 29, 2004 7:20 am
by patrikG
Store the search results in a $_SESSION variable, when the page reloads, check if that $_SESSION variable is set, and if so, use it. If not, not.

Posted: Thu Jan 29, 2004 7:25 am
by szms
Have you ever seen this kind of format when some information is visble when the mouse pointer points to a link without using title. If you have never seen seen then never mind.
Posted: Thu Jan 29, 2004 7:29 am
by patrikG
Wrong topic. I believe you wanted to reply to this topic, szms:
viewtopic.php?p=84821
Posted: Thu Jan 29, 2004 7:33 am
by szms
WHAT DO YOU MEAN?
Posted: Thu Jan 29, 2004 8:51 am
by patrikG
Posted: Thu Jan 29, 2004 1:02 pm
by Unipus
pinehead, you'd really have to post the code. But, I suspect all of your problems can be solved by just adding "return false" to the end of your function call:
<a href="asdv" onclick="popup('whatever'); return false">click</a>
Posted: Fri Jan 30, 2004 7:43 am
by szms
I tried the following code and it works perfectly. I want to show a default info: please move the mouse on the highlited text. And whenever the mouse in on the high lighted text the description of the respective topic will be shown instead of the default info. How to do that according to my code.
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.framesїn.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=dїn])&&d.all) x=d.allїn]; for (i=0;!x&&i<d.forms.length;i++) x=d.formsїi]їn];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layersїi].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(argsїi]))!=null) { v=argsїi+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>
<body>
<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1; left: 52px; top: 12px; background-color: #6699CC; layer-background-color: #6699CC; border: 1px none #000000;" onmouseover="MM_showHideLayers('Layer2','','show')" onmouseout="MM_showHideLayers('Layer2','','hide')">
<p>This is something</p>
<p>(move mouse over this box to show the other box)</p>
</div>
<div id="Layer2" style="position:absolute; width:200px; height:115px; z-index:2; left: 52px; top: 136px; visibility: hidden; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000;">
<p>this is something else</p>
<p>(this appears if you hover your mouse over the top box, and disappears when
moving the mouse away)</p>
</div>
<div id="Layer3" style="position:absolute; width:200px; height:115px; z-index:3; left: 276px; top: 12px; background-color: #0099CC; layer-background-color: #0099CC; border: 1px none #000000;" onmouseover="MM_showHideLayers('Layer4','','show')" onmouseout="MM_showHideLayers('Layer4','','hide')">
<p>this is another something</p>
<p>(move mouse over and another box appears, not bugging the first one)</p>
</div>
<div id="Layer4" style="position:absolute; width:200px; height:115px; z-index:4; left: 277px; top: 139px; background-color: #00FFFF; layer-background-color: #00FFFF; border: 1px none #000000; visibility: hidden;">this
is the box that appears if you move the mouse over the above box. move mouse
away and this one disappears again.</div>
</body>
</html>
Posted: Fri Jan 30, 2004 1:46 pm
by Unipus
why are you trying so hard to hijack this thread?