/    Sign up×
Community /Pin to ProfileBookmark

Pop-Ups Multiple Links One JS Code?

I’m making a calendar for a site and for certain days there are events. On each of those days I would like to create a link to pop-up a window to give a longer description then just the title. I found the Code below to do what I want, but I have run into 2 issues and was hoping someone could shed some light on my problems.


  • 1.

    I have many links on one Calendar page, and doing the code this way, I would have to have a JS in the header for each link. Is their a way to set a value to the link when calling the script to make it go to a specific hyper link in a new window?

  • 2.

    This script is for a button, how do I make the script do the same think but by clicking on Plain text (Hyper Link)?

    [CODE]
    <head>
    <script type=”text/javascript”>
    <!–
    function myPopup2() {
    window.open( “http://www.google.com/”, “myWindow”,
    “status = 1, height = 300, width = 300, resizable = 0″ )
    }
    //–>
    </script>
    </head>
    <body>
    <form>
    <input type=”button” onClick=”myPopup2()” value=”POP2!”>
    </form>
    <p onClick=”myPopup2()”>CLICK ME TOO!</p>
    </body>
    [/CODE]

  • Thanks.

    to post a comment
    JavaScript

    3 Comments(s)

    Copy linkTweet thisAlerts:
    @NaborneoauthorNov 20.2006 — [code=html]<a href="http://validator.w3.org/" onclick="window.open (this.href, 'child'); return false">The Validator</a>[/code][/QUOTE]

    With this code, how do I make it non-resizeable, and specific width and hight
    Copy linkTweet thisAlerts:
    @NaborneoauthorNov 20.2006 — Well thanks for everyone and there help, but I was able to figure out what to do for this.

    <i>
    </i>&lt;a href="javascript:void()" onclick="window.open('Tasting/tasting.html','pu','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=760,height=625')"&gt;6&lt;/a&gt;
    ×

    Success!

    Help @Naborneo spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...