Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: warning only for no right click?

  1. #1
    Join Date
    Dec 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default warning only for no right click?

    Hello,

    Can someone please provide a script that will just present a copyright
    warning message in any browser, when someone right clicks.

    Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not really a good idea. Your original material is copyrighted. If you suffer any significant harm through your copyrights being violated, you may sue. This is all the protection you need. If you want folks put on notice, post a copyright notice on the page. A right click script will be missed in many browsers and can cause problems with your page(s).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    If I were trying to steal something from a page, I'd just use Safari (the browser I happen to be using at the moment). I have yet to see a no right click script that works for it. It may be quite possible, but just haven't come across one that has that coded into it.

    Shouldn't be that hard to make that pop up if you want it, though.

    The javascript for it would be something like:

    <... onClick="alert('&copy; 2006 Something.com')">

    Just apply that to where the alert pops up in the javascript you are using.

    *Not sure if &copy; works in javascript. In fact, I suspect it doesn't. Not sure how you'd display a copyright symbol in JS, then.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    No it doesn't. Use
    Code:
    &#169;
    And that will be kinda annoying.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It depends upon the situation, in an alert string:

    Code:
    \xa9
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Interest. What is that? (By name... what type of character naming is it?)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I really am not sure of the precise technical name. It is the 2 digit ASCII hex value of the character preceded by the special character \x. If you want to use the 4 digit Unicode value, precede it with \u - for © that's:

    Code:
    \u00a9
    Unicode is the same as ASCII (just add the two 0's to make it 4 hex value digits) until you get above two hex digits being required to express the character's value and can therefore be used for many more characters if the user agent can display them.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    *Not sure if &copy; works in javascript. In fact, I suspect it doesn't. Not sure how you'd display a copyright symbol in JS, then.
    It doesn't, but in the example you posted, it's also an HTML attribute, and will be parsed as such before being passed to the JS interpreter.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey View Post
    It doesn't, but in the example you posted, it's also an HTML attribute, and will be parsed as such before being passed to the JS interpreter.
    Right. However, using the onclick attribute that way for a no right click alert isn't going to give the desired results.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Right. I know it's not technically 'javascript', but I know that alerts behave differently than standard html, so I called it JS.

    Thanks for the info, John.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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