Java Script Help

Jator

Golden Member
Jun 14, 2000
1,445
7
81
I am trying to make a call to a function by using a link.

However, I can only do this from a Push Button right now and would like to use a link instead.

THis is what I have tried to do:

<a href=&quot;winopen()&quot;>Day Stats (PHP)</a></small></font></p>

However, this tries to open up http://jator/2y/net/winopen()

Not what I want. Anyone who can show me my error?

Thanks.
 

Engine

Senior member
Oct 11, 1999
519
0
0
You have to put a &quot;javascript:&quot; in the url, I think. It'd be like this:

<a href=&quot;javascript:winopen()&quot;>Day Stats (PHP)</a></small></font></p>
 

Wellcky

Golden Member
Jun 1, 2000
1,499
2
81
If you dont want that flicker try this.... it will also lighten your code time in half!!

<script language=&quot;JavaScript&quot;>
function window_open(filename, x, y)
{
windowops = eval(&quot;'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=&quot; + x + &quot;,height=&quot; + y + &quot;'&quot;);
window.open(filename, 'New1', windowops);
return;
}
</script>



then for the link tag do this..

<a href=&quot;javascript:window_open('whatever.php', 450, 350)&quot;>text link(php)</a>


btw the 450,350 is the window size set in pixels.
:cool: