|
-
Apr 10th, 2004, 11:10 PM
#1
Thread Starter
Addicted Member
href ,...?
i am making a html page,but i do not know how to open 2 sites when i click then command button,for e.g,when i click "OK" button,it will link to myfavourite.html and myhobby.html
Please help me,
tHANK YOU VERY MUCH
-
Apr 11th, 2004, 05:19 AM
#2
Frenzied Member
how do you want it to go to two pages? one in the main window and one in the popup?
location.href = "mypage.html" will use the main window
window.open("weee","myotherpage.html") will open a popup.
Have I helped you? Please Rate my posts. 
-
Apr 11th, 2004, 06:53 AM
#3
Are you looking for something like this?
Code:
<a target="_blank" href="newwindow.html">
<input type="button" onclick="window.location='newpage.html'">
</a>
-
Apr 11th, 2004, 09:25 AM
#4
Thread Starter
Addicted Member
but...
but i will put this code below <form action ...> or where?
-
Apr 11th, 2004, 02:07 PM
#5
You don't have to put it in there. You don't even need <form action ....>
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 11th, 2004, 03:37 PM
#6
Hyperactive Member
Here a solution!
<?xml version="1.0" encoding="windows-1253"?>
<!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=windows-1253" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<input name="Submit" type="submit" onclick="MM_openBrWindow('newwindow.html','','width=800,height=600');MM_openBrWindow('myotherpage.ht ml','','width=800,height=600')" value="Submit" />
</form>
</body>
</html>
I made it with dreamweaver MX 2004! This opens two windows and loads
1: newwindow.html
2: myotherpage.html
Is it fine for you?
-
Apr 12th, 2004, 09:24 AM
#7
Thread Starter
Addicted Member
first I thank you very much for help
i dont know Dreamweaver MX
I only know HTML in MS frontpage
Could you please help me this:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--">
<a target="_blank" href="www.vbforums.com">
<input type="button" onclick="window.location='www.vnn.vn'">
</a>
</form>
</body>
</html>
I take this code from Visual AD,but it dosent work
Please help me
-
Apr 12th, 2004, 09:27 AM
#8
Thread Starter
Addicted Member
Originally posted by DarkX_Greece
Here a solution!
<?xml version="1.0" encoding="windows-1253"?>
<!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=windows-1253" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<input name="Submit" type="submit" onclick="MM_openBrWindow('newwindow.html','','width=800,height=600');MM_openBrWindow('myotherpage.ht ml','','width=800,height=600')" value="Submit" />
</form>
</body>
</html>
I made it with dreamweaver MX 2004! This opens two windows and loads
1: newwindow.html
2: myotherpage.html
Is it fine for you?
i thank you very much,but i dont know dreamwave mx
can you help me in MSfrontpage?
-
Apr 12th, 2004, 09:47 AM
#9
The code I gave you works in Netwscape and Firefox, but not Internet Explorer. Silly me for not testing - I might have known it would break in IE.
The reason for it not working is becuase the event is not bubbling properly. When you click on the bitton the click event for the button shoud bubble up to the <a> element but in IE it doesn't.
The following does work however, with just a hyperlink. You could insert an image of a button in place of the text:
Code:
<a target="_blank" href="www.vbforums.com" onclick="window.location='www.vnn.vn'">link text - could be an image of a button
</a>
The reason I havn't use the window.open method is because too many people have popup blockers which stop the windows from opening. Therefore it is a lot easier to steer clear of this method.
-
Apr 12th, 2004, 11:25 AM
#10
Why don't you just open another Internet Explorer (or other Browser)?
Code:
<html>
<head>
<script type="text/javascript">
var Shell = new ActiveXObject("wscript.shell");
Shell.run("iexplore http://www.othersite.com/");
document.location="http://www.site.com/";
</script>
</head>
</html>
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 12th, 2004, 11:35 AM
#11
Originally posted by «°°phReAk°°»
Why don't you just open another Internet Explorer (or other Browser)?
Code:
<html>
<head>
<script type="text/javascript">
var Shell = new ActiveXObject("wscript.shell");
Shell.run("iexplore http://www.othersite.com/");
document.location="http://www.site.com/";
</script>
</head>
</html>
Phreak
Wouldn't work too well in Netscape or Mozilla though.
-
Apr 12th, 2004, 12:52 PM
#12
Frenzied Member
Originally posted by phanbachloc
i thank you very much,but i dont know dreamwave mx
can you help me in MSfrontpage?
HTML (and JavaScript) is the same no matter which package you use to create it.
Something written in one can be opened in another perfectly well.
Have I helped you? Please Rate my posts. 
-
Apr 12th, 2004, 01:02 PM
#13
VisualAd:
It uses Shell to execute it, so as long as you have this:
Code:
Shell.Run("http://www.vbforums.com");
It will open it in the default browser. Give it a try..
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 12th, 2004, 01:06 PM
#14
Frenzied Member
Originally posted by «°°phReAk°°»
VisualAd:
It uses Shell to execute it, so as long as you have this:
Code:
Shell.Run("http://www.vbforums.com");
It will open it in the default browser. Give it a try..
Phreak
excpet it will only work in IE
Have I helped you? Please Rate my posts. 
-
Apr 12th, 2004, 01:14 PM
#15
<?="Moderator"?>
Originally posted by «°°phReAk°°»
VisualAd:
It uses Shell to execute it, so as long as you have this:
Code:
Shell.Run("http://www.vbforums.com");
It will open it in the default browser. Give it a try..
Phreak
I thought that Access to shell via Javascript/VBscript was only allowed with security turned off?
-
Apr 12th, 2004, 01:59 PM
#16
Originally posted by «°°phReAk°°»
VisualAd:
It uses Shell to execute it, so as long as you have this:
Code:
Shell.Run("http://www.vbforums.com");
It will open it in the default browser. Give it a try..
Phreak
If that works on your browser then I suggest you review your security settings. Becuase not only can the run method run any program on your system, it can also read/moidfy registry settings, execute processes, simulate key strokes and more.
No website should eever be able to to create an instance of the shell object and VB Script in IE does not allow it by default for very good reasons.
-
Apr 12th, 2004, 06:53 PM
#17
No no, a warning comes up. He asked, we replied. I do realise how it can be used..
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 12th, 2004, 10:33 PM
#18
Thread Starter
Addicted Member
Originally posted by visualAd
The code I gave you works in Netwscape and Firefox, but not Internet Explorer. Silly me for not testing - I might have known it would break in IE.
The reason for it not working is becuase the event is not bubbling properly. When you click on the bitton the click event for the button shoud bubble up to the <a> element but in IE it doesn't.
The following does work however, with just a hyperlink. You could insert an image of a button in place of the text:
Code:
<a target="_blank" href="www.vbforums.com" onclick="window.location='www.vnn.vn'">link text - could be an image of a button
</a>
The reason I havn't use the window.open method is because too many people have popup blockers which stop the windows from opening. Therefore it is a lot easier to steer clear of this method.
<a target="_blank" href="www.vbforums.com" onclick="window.location='www.vnn.vn'">link text - could be an image of a button
</a>
how can i put a command button instead of "link text-could be an image of a button?
I am beginer in html so i am very bad,please help me!
-
Apr 13th, 2004, 05:14 AM
#19
What I am saying is that it is difficult to do without it breaking in some browsers. Your main aim is to get a link to open in a blank window and also in the current window.
The HTML I gave you will work in the majority of modern day browsers as long as Javascript is enabled. If you put a button in there then it will cause the HTML to break in IE. If you use the window.location method, most users won't have the blank window open becuase of their popup blockers.
If your button is just opening a couple of links and is not a submit button on a form then you can do the follwoing with CSS to make it look and behave like a button. Give this a try:
Code:
<html>
<head>
<style type="text/css">
.up {
text-decoration: none;
font: Caption;
cursor: Default;
color: ButtonText;
border-width: 3px;
border-style: outset;
background-color: ButtonFace;
padding: 2px;
}
.down {
text-decoration: none;
font: Caption;
cursor: Default;
color: ButtonText;
border-width: 3px;
border-style: inset;
background-color: ButtonFace;
padding: 2px;
}
</style>
</head>
<body>
<a target="_blank" href="www.vbforums.com" class="up"
onclick="window.location='www.vnn.vn'"
onmousedown="this.className='down'"
onmouseout="this.className='up'"
onmouseup="this.className='up'">Click Me</a>
</body>
</html>
This has been tested in Firefox/Netscape 7.1 and IE 6
-
Apr 13th, 2004, 09:42 AM
#20
Thread Starter
Addicted Member
i thank you
my english is so bad so i cant express my idea clearly.
I thank you for your help,you are the very good friends.
I mean all along as following:
+please visit:
http://www.sfu.ca/acs/sfuwebhelp/egform.htm
+Could you please telling me how to open another site ,for eg: www.vnn.vn when we click Send Form button? and the letter will also be sent at the same time?
PLEASE HELP ME ONCE AGAIN
-
Apr 13th, 2004, 10:18 AM
#21
Frenzied Member
Originally posted by DarkX_Greece
Here a solution!
<?xml version="1.0" encoding="windows-1253"?>
<!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=windows-1253" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<input name="Submit" type="submit" onclick="MM_openBrWindow('newwindow.html','','width=800,height=600');MM_openBrWindow('myotherpage.ht ml','','width=800,height=600')" value="Submit" />
</form>
</body>
</html>
I made it with dreamweaver MX 2004! This opens two windows and loads
1: newwindow.html
2: myotherpage.html
Is it fine for you?
I really don't see how that function would be better than window.open ...
Cheers!
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Apr 13th, 2004, 10:23 AM
#22
Frenzied Member
Originally posted by vbNeo
I really don't see how that function would be better than window.open ...
Cheers!
it infact is the window.open function.
To the original poster, I think you need to take some basic HTML lessons. try http://www.w3schools.com/html/default.asp
or:
http://www.htmlgoodies.com/primers/basics.html
Have I helped you? Please Rate my posts. 
-
Apr 13th, 2004, 10:35 AM
#23
Re: i thank you
Originally posted by phanbachloc
my english is so bad so i cant express my idea clearly.
I thank you for your help,you are the very good friends.
I mean all along as following:
+please visit:
http://www.sfu.ca/acs/sfuwebhelp/egform.htm
+Could you please telling me how to open another site ,for eg: www.vnn.vn when we click Send Form button? and the letter will also be sent at the same time?
PLEASE HELP ME ONCE AGAIN
If you are submitting the form then it is a different story. The majority of popup blockers will not block popups generated by form submit events. You can therefore use the following HTML and be safe in the mind that it will work in all browsers except those without Javascript disabled:
Code:
<html>
<body>
<form action="test.html" method="post" onsubmit="window.open('http://www.vnn.vn');">
Test input: <input type="text" /><br />
<input type="submit" value="Submit Form">
</form>
</body>
</html>
-
Apr 13th, 2004, 10:39 AM
#24
Frenzied Member
Re: Re: i thank you
Originally posted by visualAd
Code:
<html>
<body>
<form action="test.html" method="post" onsubmit="window.open('http://www.vnn.vn');">
Test input: <input type="text" /><br />
<input type="submit" value="Submit Form">
</form>
</body>
</html>
now that's some wierd indentation.
Have I helped you? Please Rate my posts. 
-
Apr 13th, 2004, 10:46 AM
#25
gVim goes a bit over the top with its tabs. It looks nice though.
-
Apr 13th, 2004, 10:48 AM
#26
Frenzied Member
I don't like it that much, since it indents everuthing inside <html> and </html>, the almost whole document will be indented.
I generally don't bother indeting HTML (but I do use line breaks), except tables, and long lists (<li> or <ul>).
JS on the other hand I indent.
Have I helped you? Please Rate my posts. 
-
Apr 13th, 2004, 11:02 AM
#27
-
Apr 13th, 2004, 11:07 AM
#28
Frenzied Member
-
Apr 13th, 2004, 11:17 AM
#29
I was put off dreamWeaver at college when we had to use DreamWeaver 4. I couldn't stand it, because it had a habbit or randomly inserting and removing HTML from the source.
-
Apr 13th, 2004, 12:32 PM
#30
Frenzied Member
I think MX and MX 2003 (which I have on MY PC) still add random code. but only if you use the wysiwug side of the thing. I only use the code view, unless I'm making tables. then it doesn't add random code.
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|