View Full Version : Script working in IE7 but not other browsers

09-20-2008, 04:16 PM
1) Script Title: Disable Text Selection script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/noselect.htm

3) Describe problem: I have added this script to onew of my webpages to try it out. It works fine in IE7 and Google Chrome but in Firefox 2 (Mozilla 5) it does not work. It also does not work in Netscape 9.0b3 or Flock 1.2.5.

I thought this might be an issue with Mozilla 5 but all the browsers except IE 7 are Mozilla based.

Any thoughts or suggestions on what I need to do would be appreciated.



09-20-2008, 04:40 PM
That script was last updated at the end of '06, and was never a very good idea. The ability to select text is a part of the browser, not the design of a page.

However, I just tested the demo page in FF 3 and Flock 1.2.2 (both also Mozilla 5) - it worked fine in them. Do you think that the problem is with the script? Try FF 2 on the demo page, and let me know. If that works, it probably has something to do with your implementation.

It could be a setting though, Mozilla and some other browsers have configuration options that can disable javascript's ability to override common browser functions. Selecting text may be one of those. Also, with javascript disabled, any browser can select the text.

09-20-2008, 06:43 PM
Hi John,

Thanks for the reply. I know it is normal to allow the selection of text etc but I am trying to stop some piracy of my content.

I think the problem was with my implementation. I had the calling function placed at the end of the document just above the </html>. I have now moved it to below this and it appears to work. I should have read the instructions a little better.