Need a quick javascript done

Discussion in 'Programming' started by alaas, Jan 24, 2010.

  1. #1
    Hi,

    I need a really quick javascript done. Basically, I need to create a javascript that will open a new url window when someone clicks their mouse on the webpage.

    That is it. Nothing more, nothing less.

    If you know how to do this and want to make a quick $10 this is the job for you.

    thanks
     
    alaas, Jan 24, 2010 IP
  2. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    more than capable of doing this for you, let me know.
     
    ansi, Jan 24, 2010 IP
  3. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    Wrap everything inside a div, and use the onclick attribute to enable redirecting to a link when clicking anywhere on the page.
    Why would you need something like that though?

    onclick="window.location='http://www.yoururl.com'"
    Code (markup):
     
    Clive, Jan 24, 2010 IP
  4. codemaster263

    codemaster263 Member

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    Simple JavaScript task. My Yahoo: tashinga_p. Thanks
     
    codemaster263, Jan 25, 2010 IP
  5. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    If you simply want clicking anywhere on the page to redirect to a specified URL, use:
    <div onclick="window.location='http://www.yoururl.com'">
     ...... . .......
     Page Content Goes Here
     ...... . .......
    </div>
    Code (markup):
    If you want the whole page to act as a link with the cursor changing to a pointer, then use:

    <div onclick="window.location='http://www.yoururl.com'" style="cursor:pointer">
     ...... . .......
     Page Content Goes Here
     ...... . .......
    </div>
    Code (markup):
    There you go.

    Shame on you, ansi for the negative reaction when someone's willing to help.
    Good luck hunting for your ten bucks :)
     

    Attached Files:

    • rep.jpg
      rep.jpg
      File size:
      5.9 KB
      Views:
      42
    Last edited: Jan 26, 2010
    Clive, Jan 26, 2010 IP
  6. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    at the time i could of really used it, that is all.
     
    ansi, Jan 26, 2010 IP
  7. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    I know, like pay your monthly rent. Are you sure you're located in Florida? Helping others doesn't hurt, you can earn some of your customers that way, too.
     
    Clive, Jan 26, 2010 IP
  8. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    not quite sure i'm following you on the rent thing but anyway i help others every day i'm not worried about that. he offered $10 to someone, i offered to do the job and then you came along and just gave it away, that's why i was upset. doing that after i had already made a post offering to do the work was wrong.
     
    ansi, Jan 26, 2010 IP