SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast Traduim's Avatar
    Join Date
    Feb 2003
    Location
    Catalonia
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with createRange() in browsers != IE

    I have a nice Javascript code which allows users to HTML format code in a textarea, similar to the code of Post New Thread page. It works great in Internet Explorer but it does nothing in other browsers.

    It seems the problem resides in this two lines:
    Code:
    a=document.selection.createRange();
    seleccio = a.text;
    How can I arrange this lines in order to make them cross-browser? I really need this code to work, at least, in current versions of Netscape, Mozilla and Opera.
    Josep Tarrés,
    traducción
    traductor

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    Fort Lauderdale
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This works in NS.
    Code:
    a = document.getSelection();
    Check this out: cross browser selection

    www.unpossiblemedia.com - A Fort Lauderdale based multimedia company.

  3. #3
    SitePoint Enthusiast Traduim's Avatar
    Join Date
    Feb 2003
    Location
    Catalonia
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good article, thanks
    Josep Tarrés,
    traducción
    traductor


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
  •