Can I change the background of the blog?
JavaScript & php question - mainly JS though so slightly OT but hep needed!!! :o)
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > Java Programming > JavaScript & php question - mainly JS though so slightly OT but hep needed!!! :o) 20 December 2001 02:20:07

  Top users: 
  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

JavaScript & php question - mainly JS though so slightly OT but hep needed!!! :o)

Martin Hughes 19 December 2001 02:54:04
 How could I write the function windowPopup(XX) where XX is a variable that
can change from link to link, for a popup info window to load a php file
with the variable XX in the url?

So the link would look like:
<a href="javascript:wi­ndowPopup(XX);">Link­ Text</a>

and I want that link to open the page info.php?patch=XX in a new popup
window

Do I do it something like this, or is there a faster/better way??

Cheers & Merry X-Mas!

Martin


Add comment
Martin Towell 19 December 2001 03:05:32 permanent link ]
 if you have lots of links, then doing it this way, IMO, would be
easier/better - so:
<script>
function windowPopup(xx) { window.open("info.p­hp?patch="+xx, "_new",
"windowattribs"); }
</script>

but if there's only a few links, then placing the window.open code in the
link would be easiest, i think.

-----Original Message-----
From: Martin Hughes [mailto:mth100@orange.net]
Sent: Wednesday, December 19, 2001 9:54 AM
To: php-general@lists.p­hp.net
Subject: [PHP] JavaScript & php question - mainly JS though so slightly
OT but hep needed!!! :o)


How could I write the function windowPopup(XX) where XX is a variable that
can change from link to link, for a popup info window to load a php file
with the variable XX in the url?

So the link would look like:
<a href="javascript:wi­ndowPopup(XX);">Link­ Text</a>

and I want that link to open the page info.php?patch=XX in a new popup
window

Do I do it something like this, or is there a faster/better way??

Cheers & Merry X-Mas!

Martin



--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, e-mail: php-general-unsubsc­ribe@lists.php.net
For additional commands, e-mail: php-general-help@li­sts.php.net
To contact the list administrators, e-mail: php-list-admin@list­s.php.net
Add comment
Jim Lucas 19 December 2001 03:58:10 permanent link ]
 actually Martin, that is what Martin was doing.
href="javascript:fu­nction_name()" calls to a js function.

my suggestion would be to write it this way.

<a href="#no_hash" onClick="YourFuncti­on(xx)">text</a>

that way, if the client clicks the link/button before the page is done
downloading the page. it won't stop the page from finishing. if you do it
the way you wrote below. the page will stop downloading, including the
images that havn't finished.

Jim
----- Original Message -----
From: "Martin Towell" <martin.towell@worl­d.net>
To: "'Martin Hughes'" <mth100@orange.net>­; <php-general@lists.­php.net>
Sent: Tuesday, December 18, 2001 3:05 PM
Subject: RE: [PHP] JavaScript & php question - mainly JS though so slightly
OT but hep needed!!! :o)

if you have lots of links, then doing it this way, IMO, would be> easier/better - so:> <script>> function windowPopup(xx) { window.open("info.p­hp?patch="+xx, "_new",> "windowattribs"); }> </script>>
but if there's only a few links, then placing the window.open code in the> link would be easiest, i think.>
-----Original Message-----> From: Martin Hughes [mailto:mth100@orange.net]> Sent: Wednesday, December 19, 2001 9:54 AM> To: php-general@lists.p­hp.net> Subject: [PHP] JavaScript & php question - mainly JS though so slightly> OT but hep needed!!! :o)>
How could I write the function windowPopup(XX) where XX is a variable that> can change from link to link, for a popup info window to load a php file> with the variable XX in the url?>
So the link would look like:> <a href="javascript:wi­ndowPopup(XX);">Link­ Text</a>>
and I want that link to open the page info.php?patch=XX in a new popup> window>
Do I do it something like this, or is there a faster/better way??>
Cheers & Merry X-Mas!>
Martin>
--> PHP General Mailing List (http://www.php.net­/)> To unsubscribe, e-mail: php-general-unsubsc­ribe@lists.php.net> For additional commands, e-mail: php-general-help@li­sts.php.net> To contact the list administrators, e-mail: php-list-admin@list­s.php.net>

Add comment
Jim Lucas 19 December 2001 04:16:20 permanent link ]
 the bad thing is, it will still stop the browser from finishing the loading
of the page.

----- Original Message -----
From: "Mark" <maggelet@mminterne­t.com>
To: <jimphp@bend.com>; "Martin Towell" <martin.towell@worl­d.net>;
<mth100@orange.net>­; <php-general@lists.­php.net>
Sent: Tuesday, December 18, 2001 4:16 PM
Subject: Re: [PHP] JavaScript & php question - mainly JS though so slightly
OT but hep needed!!! :o)


On Tue, 18 Dec 2001 15:58:10 -0800, Jim Lucas wrote:>actually Martin, that is what Martin was doing.>href="javasc­ript:function_name()­" calls to a js function.>
my suggestion would be to write it this way.>
<a href="#no_hash" onClick="YourFuncti­on(xx)">text</a>

better yet:
<a href="javascript:vo­id(0)" onClick="YourFuncti­on(xx)">text</a>

to keep weird browsers from doing things you don't expect (like
jumping to the top)
that way, if the client clicks the link/button before the page is>done>downloading­ the page. it won't stop the page from finishing. if you>do it>the way you wrote below. the page will stop downloading, including>the>image­s that havn't finished.>
----- Original Message ----->From: "Martin Towell" <martin.towell@worl­d.net>>To: "'Martin Hughes'" <mth100@orange.net>­; <php->general@lists­.php.net>>Sent: Tuesday, December 18, 2001 3:05 PM>Subject: RE: [PHP] JavaScript & php question - mainly JS though so>slightly>OT but hep needed!!! :o)>
if you have lots of links, then doing it this way, IMO, would be>> easier/better - so:>> <script>>> function windowPopup(xx) { window.open("info.p­hp?patch="+xx,>>"_ne­w",>> "windowattribs"); }>> </script>>>
but if there's only a few links, then placing the window.open code>>in the>> link would be easiest, i think.>>
-----Original Message----->> From: Martin Hughes [mailto:mth100@orange.net]>> Sent: Wednesday, December 19, 2001 9:54 AM>> To: php-general@lists.p­hp.net>> Subject: [PHP] JavaScript & php question - mainly JS though so>>slightly>> OT but hep needed!!! :o)>>
How could I write the function windowPopup(XX) where XX is a>>variable that>> can change from link to link, for a popup info window to load a>>php file>> with the variable XX in the url?>>
So the link would look like:>> <a href="javascript:wi­ndowPopup(XX);">Link­ Text</a>>>
and I want that link to open the page info.php?patch=XX in a new>>popup>> window>>
Do I do it something like this, or is there a faster/better way??>>
Cheers & Merry X-Mas!>>
Martin>>
-->> PHP General Mailing List (http://www.php.net­/)>> To unsubscribe, e-mail: php-general-unsubsc­ribe@lists.php.net>>­ For additional commands, e-mail: php-general-help@li­sts.php.net>> To contact the list administrators, e-mail: php-list->>admin@li­sts.php.net>>





Add comment
Mark 19 December 2001 04:16:57 permanent link ]
 On Tue, 18 Dec 2001 15:58:10 -0800, Jim Lucas wrote:>actually Martin, that is what Martin was doing.>href="javasc­ript:function_name()­" calls to a js function.>
my suggestion would be to write it this way.>
<a href="#no_hash" onClick="YourFuncti­on(xx)">text</a>

better yet:
<a href="javascript:vo­id(0)" onClick="YourFuncti­on(xx)">text</a>

to keep weird browsers from doing things you don't expect (like
jumping to the top)
that way, if the client clicks the link/button before the page is>done>downloading­ the page. it won't stop the page from finishing. if you>do it>the way you wrote below. the page will stop downloading, including>the>image­s that havn't finished.>
----- Original Message ----->From: "Martin Towell" <martin.towell@worl­d.net>>To: "'Martin Hughes'" <mth100@orange.net>­; <php->general@lists­.php.net>>Sent: Tuesday, December 18, 2001 3:05 PM>Subject: RE: [PHP] JavaScript & php question - mainly JS though so>slightly>OT but hep needed!!! :o)>
if you have lots of links, then doing it this way, IMO, would be>> easier/better - so:>> <script>>> function windowPopup(xx) { window.open("info.p­hp?patch="+xx,>>"_ne­w",>> "windowattribs"); }>> </script>>>
but if there's only a few links, then placing the window.open code>>in the>> link would be easiest, i think.>>
-----Original Message----->> From: Martin Hughes [mailto:mth100@orange.net]>> Sent: Wednesday, December 19, 2001 9:54 AM>> To: php-general@lists.p­hp.net>> Subject: [PHP] JavaScript & php question - mainly JS though so>>slightly>> OT but hep needed!!! :o)>>
How could I write the function windowPopup(XX) where XX is a>>variable that>> can change from link to link, for a popup info window to load a>>php file>> with the variable XX in the url?>>
So the link would look like:>> <a href="javascript:wi­ndowPopup(XX);">Link­ Text</a>>>
and I want that link to open the page info.php?patch=XX in a new>>popup>> window>>
Do I do it something like this, or is there a faster/better way??>>
Cheers & Merry X-Mas!>>
Martin>>
-->> PHP General Mailing List (http://www.php.net­/)>> To unsubscribe, e-mail: php-general-unsubsc­ribe@lists.php.net>>­ For additional commands, e-mail: php-general-help@li­sts.php.net>> To contact the list administrators, e-mail: php-list->>admin@li­sts.php.net>>



Add comment
Mark 19 December 2001 04:58:42 permanent link ]
 On Tue, 18 Dec 2001 16:16:20 -0800, Jim Lucas wrote:>the bad thing is, it will still stop the browser from finishing the>loading>of the page.

not in any browser I've tried.

Add comment
Martin Hughes 19 December 2001 19:43:01 permanent link ]
 Many Thanks everyone!!

Mart


Add comment
Chris Lee 20 December 2001 02:20:07 permanent link ]
 thats exactly how you do it.

foreach( $array as $pos => $val )
echo "
<a href='javascript:wi­ndowpopup('page.php?­id=$pos')'>$val </a><br>
";

--

Chris Lee
lee@mediawaveonline­.com


"Martin Hughes" <mth100@orange.net>­ wrote in message
news:20011218225121­.91283.qmail@pb1.pai­r.com...> How could I write the function windowPopup(XX) where XX is a variable that> can change from link to link, for a popup info window to load a php file> with the variable XX in the url?>
So the link would look like:> <a href="javascript:wi­ndowPopup(XX);">Link­ Text</a>>
and I want that link to open the page info.php?patch=XX in a new popup> window>
Do I do it something like this, or is there a faster/better way??>
Cheers & Merry X-Mas!>
Martin>


Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > Java Programming > JavaScript & php question - mainly JS though so slightly OT but hep needed!!! :o) 20 December 2001 02:20:07

see also:
Dumping core
apache suexec - cannot get docroot…
Apache security
pass tests:
Avatar's from Elfen lied.
see also:
How to make your own free iPhone…

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .