SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Feb 10, 2001, 09:15 #1
- Join Date
- Feb 2001
- Location
- Central Kentucky
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey there folks, one question, it is probably so simple I could smack myself, but I am very new to java. I have the code worked out, I just need to know how to call it from a hyperlink on an existing page. The code is as follows:
<script>
window.open('http://www.mysite.net/chat.htm', 'DummyName', 'height=350,width=520', false);
</script>
This works fine on a page by itself, but it opens the "chat.htm" page, as well as one before it that runs the code. It would be much better to just run it from a hyperlink button from the main page and not load the first unnecessary page in the first place. Thanks for any and all help. I know this has to be something very simple that I just haven't caught/stumbled onto yet.Last edited by palerider; Feb 10, 2001 at 18:36.
--==PaleRider==--
-
Feb 10, 2001, 14:04 #2
- Join Date
- Mar 2000
- Location
- Muskegon, MI
- Posts
- 2,328
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You would want to set that script as a function. Add a trigger in a hyperlink (onclick="myFunction()").
-
Feb 10, 2001, 18:18 #3
- Join Date
- Feb 2001
- Location
- Central Kentucky
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Okay, here's what I've got so far. It is functional and does what I want, but, I would rather it use one of my custom made buttons rather than the form element "button".You know, like an "a href" statement that is standard for clicking a link button. This would fit in much better with the site. Like I say, I am new to all of this, very new, I started playing with this java stuff only yesterday. I have done a bit of programming but that was a loooong time ago, and that was in QB 4.5 and TP 7. I have the fundamentals but blending it all with html get's me cockeyed and dizzy.
Thanks again.
<SCRIPT LANGUAGE="JavaScript">
<!--
function openURL(winName, newURL) {
win = window.open("", winName, 'height=340,width=520', false);
win.location.href = newURL;
}
// -->
</SCRIPT>
<FORM>
<INPUT TYPE="button" VALUE="Enter Live Chat"
onClick="openURL('chat', 'http://www.mysite.net/chat.htm')">
</FORM>Last edited by palerider; Feb 10, 2001 at 18:35.
--==PaleRider==--
-
Feb 10, 2001, 19:28 #4
Try this:
<SCRIPT LANGUAGE="JavaScript">
<!--
function openURL(winName, newURL) {
win = window.open("", winName, 'height=340,width=520', false);
win.location.href = newURL;
}
// -->
</SCRIPT>
<A HREF="javascript:openURL('chat', 'http://www.mysite.net/chat.htm')"><IMG SRC="filename.gif" border="0"></A>
-
Feb 10, 2001, 23:30 #5
- Join Date
- Feb 2001
- Location
- Central Kentucky
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
"<A HREF="javascript:openURL"
That's the bit that was hanging me. Thanks a BUNCH, your help is much appreciatedLast edited by palerider; Feb 11, 2001 at 12:22.
--==PaleRider==--
Bookmarks