• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Safari "do javascript" busted?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari "do javascript" busted?


  • Subject: Re: Safari "do javascript" busted?
  • From: "Listout" <email@hidden>
  • Date: Tue, 26 Apr 2005 1:37:28 -0000
  • Importance: Medium

Daniel Jalkut <email@hidden>
> Hi - I saw a similar problem discussed on the macscript mailing list.
>
> In response to that issue I tinkered a bit and discovered that
> modifying the javascript to use &quot;unescape(getSelection())&quot;
instead of
> &quot;getSelection()&quot; seems to work around the problem.
>
> For some reason Safari seems willing to return the text from unescape
> but not from getSelection() directly.
>
> Hope this helps,
> Daniel

Pardon if this post is formatted oddly. I am using a web mail client and the
editing field is about 40 characters wide. (Why do people invest time in
something and then...oh, never mind.)

Daniel, I contributed some suggested JS code in that thread you reference,
using unescape() and so forth. There may be a clue in that code to make a
Safari experiment.

What I wonder (I don't use Safari) is whether there are any differences when
you apply that method to different objects.

For instance, all the references that are being made lately show on the
method. What happens if you target the 'window' versus the 'document'
object?  (That method can work with a textarea or input as well, BTW.)

I think you could work an experiment like this (not tested, pseudo-code):

if (! s = window.getSelection()) s = document.getSelection();

Now, the original code I submitted (I can't look right now) did an
object-model check too, like 'document.all', to branch around the 2 major
behaviors of locating an object in the tree.

Anyway, I just wonder if trying the getSelection() method on those objects
yields any useful results.

--
Gary

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Safari "do javascript" busted?
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Foo Bar
  • Next by Date: Re: Safari "do javascript" busted?
  • Previous by thread: Re: Safari "do javascript" busted?
  • Next by thread: Re: Safari "do javascript" busted?
  • Index(es):
    • Date
    • Thread