Web Hosting Talk







View Full Version : : Basic javascript question :


ACIDman
08-12-2003, 09:47 PM
Hi, guys!:)
How can I make the link, which will open a new window with fixed size?
Maybe, there's a way to do it in PHP?

Thanx:)

Burhan
08-12-2003, 09:57 PM
<a href="#" onclick="window.open('file.html','mywindow','width=30,height=40');">open a window</a>

Next time, STFW.

ACIDman
08-13-2003, 12:09 AM
Ok. Thanx!:)

Rich2k
08-13-2003, 04:51 AM
Maybe, there's a way to do it in PHP?

It's not PHP, it's HTML and JavaScript.

The serverside language is irrelevant.

Note: you need to account for pop-up blockers if your site will rely on this window.

ACIDman
08-14-2003, 01:08 PM
Yeah, I know that it's Java.
And I need this for like a little help for users.
This code works in Opera, but doesnt seem to work in IE!... :(
It says something about "incorrect symbol". And my code is:
<a href='#' onclick="window.open('help/textformat.htm','Text formatting','width=300,height=200');">Text formatting</a>

I guess the code is ok! But.. Why doesnt it work in IE?...

jb4mt
08-14-2003, 01:39 PM
Originally posted by ACIDman
Yeah, I know that it's Java.

Java is NOT Javascript. Get a clue.

fshost
08-14-2003, 02:10 PM
Javascript was originally called livescript, but to get ground fast they called it javascript to make users think it has the power of Java :)

Rich2k
08-14-2003, 05:58 PM
And now it's technically called ECMA script :)

ACIDman
08-14-2003, 10:48 PM
yeah, I know:).. JAvascript os for scripts and Java - is a crossplatform language. Just like Visual Basic and VB Scripts but..Visual Basic is notThanx anyway (but VB is only for windows)...
But what about my error? Can that be something with security/javamchine settings?
Hmm..My IE runs javascripts normally... I guess..:D
Let me check it again..
---
Hmm.. Even with low security settings it doesnt seem to work. But in Opera and Mozilla it works properly! ..
?!

digitok
08-15-2003, 10:29 AM
No need to be so rude jb4mt.

jb4mt
08-15-2003, 01:38 PM
Originally posted by digitok
No need to be so rude jb4mt.
Report me to the moderators

raulgonzalez
08-15-2003, 03:22 PM
<html>
<head>

<title>your tiltle</title>



<script language="javascript" type="text/javascript">

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}

</script>
</head>

<body>

<a href="http://YOURSITE.com/FILE.html" onclick="NewWindow(this.href,'name','300','300','yes');return false">LINK DESCRIPTION</a>


</body>
</html>

ACIDman
08-15-2003, 05:36 PM
Thaaanx again!:)

digitok
08-15-2003, 10:25 PM
jb4mt,

I didn't say I was going to report you, I just told you not to be so rude.

He only wanted some help, and if you want to help, then do so, otherwise, kindly keep your mouth shut.

jb4mt
08-16-2003, 11:46 AM
Originally posted by digitok
jb4mt,

I didn't say I was going to report you, I just told you not to be so rude.

He only wanted some help, and if you want to help, then do so, otherwise, kindly keep your mouth shut.

So putting "kindly" in front of "keep your mouth shut" makes the latter not rude?!?

PS....I did help, by reminding the OP that Java and Javascript are not the same. I know that I immediately right people off as buffoons, if they are purported to have some sort of technical expertise in the area, but confuse the two.