Hey all,
I am slowly learning how this all works, but one thing I cannot get to work, I need to have the comment link on http://wildcat.arizona.edu/papers/97/86/comments.html

Open to a new window 300x600 and without a toolbar, address bar and all that.

I've seen a lot of different ways to do it in javascript, only problem is the link is totally dynamic and doesnt seem to work with the javascript in there...

is there any other way to do this?

Here is the code I need to change...

<? // link: number of comments
if ($blog_id != urldecode($show_id) && $num >1) {?>
<span class="blogkomm_a"> [ <a class="blogkomm_a" href="<?echo $PHP_SELF?>?show_id=<?echo $blog_id;?>#bk_<?echo $blog_id;?>"><? echo "$num comments";?></a> ] </span>

Thanks!

    <? should be <?= or preferably <?php

      Originally posted by Shrike
      <? should be <?= or preferably <?php

      That didnt really address my problem at all...

        I was just pointing out an error...Paste the link which is generated.

          Make the popup function in js like you normally would passing it a url.

          Then dynamically make the link calling the js function w/ the url.

          i.e.

          js--
          function pop_up(url){

          ...open..(url, 'width=300', height='600', ....);

          }

          <a href="#" onclick="pop_up('<? echo out the url here');">jkl;;lkj</a>

            ^ He's right. If you are having problems it is ALWAYS worth ripping it right back to bone basics. i.e: no PHP

            If you can get it to work manually without dynamics you can then easilly integrate the PHP to make it change the thing which needs changing. In your case: the URL.

              Originally posted by mtimdog
              Make the popup function in js like you normally would passing it a url.

              Then dynamically make the link calling the js function w/ the url.

              i.e.


              js--
              function pop_up(url){

              ...open..(url, 'width=300', height='600', ....);

              }

              <a href="#" onclick="pop_up('<? echo out the url here');">jkl;;lkj</a>

              Alright! Got it to work, before I was trying to put the <? echo statemtent in the href heading rather than 'onclick'

              Thanks for your help!

                Hi!

                It's not advisable to use OnClick as this doesn't work on some browsers, use onmousedown instead of onclick.

                why not pass pop_up() directly into the href e.g.

                <a href="javascript:pop_up(url);"></a>

                hope it helps

                  Originally posted by Xoid
                  Hi!

                  It's not advisable to use OnClick as this doesn't work on some browsers, use onmousedown instead of onclick.

                  why not pass pop_up() directly into the href e.g.

                  <a href="javascript:pop_up(url);"></a>

                  hope it helps

                  Hey there,
                  I was trying before to have the javascript command in the href but for some reason it wasnt working...

                  I guess I will have to test it out on diff. systems to see if its working or not...

                  Thanks!

                    As a website designer, is one really interested in the 2% of people who use browsers not supporting onclick??😃 😃

                    I guess it really depends on your audience--average users that don't know what a browser is (they just click on the nice little aol icon ....what's a browser??) or people in the computer industry running Firebird on a modded-out Linux box.

                      You don't even have to create the function first, but can pass all vars for the window in the url:

                      <A HREF="#" onMouseOver="window.status='This is a status message';return true;"
                      onMouseOut="window.status='';return true;" onClick="window.open('myscript.php','windowname',
                      'width=200,height=300,menubar=no,scrollbars=no,status=no,
                      toolbar=no,resizable=yes,left=50,top=50,
                      screenx=50,screeny=50');return false;">Long link!</a>
                      

                      knutm :-)

                        I can't seem to get the sta and the tus on the same line here?

                        Ah, well..

                        knutm ;-)

                          Write a Reply...