Results 1 to 3 of 3

Thread: Javascript

  1. #1
    Join Date
    Jun 2004
    Location
    U.S.A
    Posts
    1,463

    Javascript

    Hey mates!
    I am working on my new hosting companies website and I have run into a bit of trouble with a javascript code link. What I am trying to do is create a link which will open up a popup window showing a baisc page with all the packages listen in comparison.

    I have created a blank .html page with the packages and named it paidplans.html

    Heres the code I put into the "Link" box in Dreamweaver MX 2004.
    Code:
    <a href="javascript:popUp('http://www.xenahosting.com/popups/paidplans.html')">Click here</a>
    *thats how the code looked when I pasted it in the link box but in the box obviously its one long line of code, but when I copied and pasted hat code here, it showed up the way I originally pasted it.


    However when I upload the page and click the link, this is what I get..
    Code:
    http://www.xenahosting.com/%3Ca%20hr...vascript:popUp(%27http://www.xenahosting.com/popups/paidplans.html%27)%22%3EClick%20here%3C/a%3E
    Any idea whats going on?

    Thanks,
    Mike

  2. #2
    Join Date
    May 2005
    Location
    Planet Earth
    Posts
    813
    Hi,

    first you have a space between java and script in "java script:....".

    It would be nice to have a look at you script, if you can give us a link to this very page.

    Regards
    PutFile.io Disrupting traditional file hosting.
    █ Signup Early and enjoy Unlimited space/bandwidth for your files hosting, Forever!
    █ No Ads.
    █ No Countdowns.

  3. #3
    Join Date
    Jun 2004
    Location
    Digital Texas
    Posts
    55
    lmao. You wouldnt do the javascript in the href part.

    Your tag should look like this.

    <a href="#" OnClick="popUp('http://www.xenahosting.com/popups/paidplans.html')">My Link</a>

    And if you want you can even do this for the status window below. So users dont see the url as # (normally a indicator for pages under construction)

    <a href="#" OnClick="popUp('http://www.xenahosting.com/popups/paidplans.html')" OnMouseOver="window.status('My Status'); return true;" OnMouseOut="window.status(''); return true;">My Link</a>

    This all is, of course, assuming you have a function named popUp in your javascript that will open a new window. Otherwise, youll use window.open(); instead of "popUp" ... someone more fluent in javascript will probably correct me, but I believe those are the right commands.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •