473,545 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I "convert" this to a "function"?

Probably the wrong wording but since I'm not a scripter I won't claim
to know what I'm talking about.

I got this script from www.htmlgoodies.com

<script language="JavaS cript">
<!--
window.open ('photos01.html ','photogallery ',config='heigh t=550,
width=750,toolb ar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no');
-->
</SCRIPT>

Obviously, it opens a new browser window with my Photo Gallery in it.

How do I convert it into a "function" in the <head> section to call
later from a link or from within a Flash movie? And, what is the
wording that I would use to call it that would be placed in the <a
href="javascrip t:??> section?

Thanks for the help!

Mike
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 20 '05 #1
5 2760

"Michael Stevens" <bigmikeatbigmi kesdotorg> wrote in message
news:h8******** *************** *********@4ax.c om...
Probably the wrong wording but since I'm not a scripter I won't claim
to know what I'm talking about.

I got this script from www.htmlgoodies.com

<script language="JavaS cript">
<!-- ]
function winOpen()

{

window.open ('photos01.html ','photogallery ',config='heigh t=550,
width=750,toolb ar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no');

}
or better still

function winOpen(url)

{

window.open ( url ,'photogallery' ,config='height =550,
width=750,toolb ar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no');

}

-->
</SCRIPT>

you can call like this

<a href=javascript : winOpen('photos 01.html') > mylink </a>



Obviously, it opens a new browser window with my Photo Gallery in it.

How do I convert it into a "function" in the <head> section to call
later from a link or from within a Flash movie? And, what is the
wording that I would use to call it that would be placed in the <a
href="javascrip t:??> section?

Thanks for the help!

Mike
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---
Jul 20 '05 #2
On Sat, 26 Jul 2003 18:23:37 +0800, "Mosley Jones III"
<me@info.gov.ma rs> woke me from my slumber by saying:
or better still

function winOpen(url)
{
window.open ( url ,'photogallery' ,config='height =550,
width=750,toolb ar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no');
}
-->
</SCRIPT>

you can call like this

<a href=javascript : winOpen('photos 01.html') > mylink </a>


So, again remember my ignorance, in javascript the window.open
function has basically three variables (url, name, config) and they
appear in that order so that in your "better" example since url is not
inside ' ' the function assumes that the variable, in this case the
url, will be supplied when called from a link? Just so I know what's
going on. It's easier to mess with when you know what's going on.

Thanks for the help!

Mike
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 20 '05 #3
On 26 Jul 2003 04:38:40 +0200, Lasse Reichstein Nielsen
<lr*@hotpop.com > woke me from my slumber by saying:
Michael Stevens <bigmikeatbigmi kesdotorg> writes:
Probably the wrong wording but since I'm not a scripter I won't claim
to know what I'm talking about.

I got this script from www.htmlgoodies.com

<script language="JavaS cript">
<!--
window.open ('photos01.html ','photogallery ',config='heigh t=550,
width=750,toolb ar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no');
-->
</SCRIPT>


Not impressive code.


I don't know that it is supposed to be ...
Obviously, it opens a new browser window with my Photo Gallery in it.

How do I convert it into a "function" in the <head> section to call
later from a link or from within a Flash movie?


Don't know about Flash, but if you want to call it from a link, you might
want to call it from more than one link, so I have made the actual URL
an argument of the function.

This should be what you need:

<script type="text/javascript">
function myOpenWindow(ur l) {
window.open(url ,"photogallery" ,"heigth=550,wi dth=750,toolbar =no,"+
"menubar=no,scr ollbars=no,resi zable=no,locati on=no,"+
"directories=no ,status=no");
}
</script>

Every change compared to the original is deliberate and for the better.
And, what is the wording that I would use to call it that would be
placed in the <a href="javascrip t:??> section?


Don't use "href='javascri pt:...'" (it's in the FAQ, which is sadly down
at the moment: <URL:http://jibbering.com/faq/>.
Instead:

<a href="photos01. html" target="photoga llery"
onclick="myOpen Window(this.hre f);return false;">
link text</a>(opens in new window)

Make it obvious that clicking this link will open a new window.
Make sure that people without javascript can also use the page.


Actually, that's a good idea. I don't know how that will be
implemented in Flash but I'll have to do some checking & playing
around to see how to make it work.

One question: if someone doesn't have javascript enabled how will they
be able to use the page? Your HREF doesn't have a "javascript:... " in
it but that doesn't change the fact that it is calling a JavaScript
function, does it?

Thanks,

Mike
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 20 '05 #4
Michael Stevens <bigmikeatbigmi kesdotorg> writes:
One question: if someone doesn't have javascript enabled how will they
be able to use the page? Your HREF doesn't have a "javascript:... " in
it but that doesn't change the fact that it is calling a JavaScript
function, does it?


If they don't have javascript (or it isn't enabled) then it will act
as a normal link with a target. The page whose URL is in the "href"
attribute, is openend in a new window with the name taken from the
"target" attribute. The javascript is never executed. The only thing
that the javascript does is to add the "config" part of the window.open
call, to change the initial size and properties of the new window.
Without javascript, you just get a plain new window, but it works.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #5
On 27 Jul 2003 13:12:46 +0200, Lasse Reichstein Nielsen
<lr*@hotpop.com > woke me from my slumber by saying:
Michael Stevens <bigmikeatbigmi kesdotorg> writes:
One question: if someone doesn't have javascript enabled how will they
be able to use the page? Your HREF doesn't have a "javascript:... " in
it but that doesn't change the fact that it is calling a JavaScript
function, does it?


If they don't have javascript (or it isn't enabled) then it will act
as a normal link with a target. The page whose URL is in the "href"
attribute, is openend in a new window with the name taken from the
"target" attribute. The javascript is never executed. The only thing
that the javascript does is to add the "config" part of the window.open
call, to change the initial size and properties of the new window.
Without javascript, you just get a plain new window, but it works.

/L


Cool.

As I was pondering how to execute that in Flash it dawned on me that I
probably won't have to worry about it. There seem to be those people
that disable everything but plain old html. So, if they're viewing the
Flash file chances are pretty good that they have javascript enabled
as well as their Flash plugin.

Thanks again,

Mike
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
18706
by: Bradley Plett | last post by:
I have what should be a trivial problem. I am using XMLSerializer to serialize an object. It serializes boolean values as "True" and "False". I then want to use an XSLT on this XML, and I want to use one of these booleans in a test. How do I convert one of these to a boolean in a test?!? I know that I could compare it as a string to...
6
6706
by: Clément Collin | last post by:
I working on a GIS project, with Access link which just need a little routine in VBA, but I haven't knowledges in VBA language. It's very simple, and it looks like that in a TPascal way : .... Var RecordNb : integer ; .... {Command : function of Access}
7
30762
by: Jim Bancroft | last post by:
Hi everyone, A basic one here, I think. I haven't found the pattern yet, but sometimes when I cast a variable to another type using the "C" style cast operator the compiler refuses to play along. It says it's an invalid cast. However, if I use the Convert.ToInt32() method (for example) things will work. At least, that's how it appears to...
5
29030
by: Greg Collins [InfoPath MVP] | last post by:
I couldn't find anything in my searches... I'm wondering if there's a Regex (with or without additional C# code) that can convert a either "lowerCamelCase" or "UpperCamelCase" into a proper "Title Case" (with spaces). Thanx! -- Greg Collins Please visit: http://www.InfoPathDev.com
3
65568
by: duprejonathan | last post by:
Hello, i don't know how to format a string with an SQL select query for my VB6 App. I have a table like this : Code - Name 1 - Jonathan 2 - Mike .... 9 - Claudia 10 - Robbie
1
7519
by: sensamecca | last post by:
I need to convert single bytes to their Hex equivalent in C#. This means a 2 character representation in a string that is the hex number. This is done with the Hex function in VB to which there appears to be no equivalent in C#. So if I had an array of bytes and I was going through a loop (lets say byte b = new byte) ... Fill the byte...
6
24305
by: arti | last post by:
I dont want to use Convert(Char(9),date,106) function to show date in dd/MM/yyyy format. It changes the datatype of my column to char & I cant perform other date operations on it without changing it back to datetime. Is there any T-sql way of doing it?
28
2821
by: Jess | last post by:
Hello, It is said that if I implement a "swap" member function, then it should never throw any exception. However, if I implement "swap" non- member function, then the restriction doesn't apply. Can somebody tell me why? Thanks, Jess
4
2480
by: jiatiejun | last post by:
I want to convert a path from ~/xxx/xxx.gif to 'http://xxxxxxx/xxx/xxx.gif' how to convert it? thanks btw: the convert function allow
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.