Pass A URL w/Javascript
Mark Brownell
gizmotron at earthlink.net
Tue Aug 12 18:28:00 EDT 2003
On Tuesday, August 12, 2003, at 03:43 PM, Scott Rossi wrote:
> Recently, "Mark Brownell" wrote:
>
>> test this if you know how:
>>
>> <a href="#"
>> onclick="window.open('http://
>> www.ibm.com','Windowname','menubar,status,scrollbars,resizable,toolbar
>> ,l
>> ocation,width=600,height=800');"> Click IBM for new window</a>
>>
>> That is if you can figure out how to pass all this in a go URL
>> handler.
>> I've been all over the cookbook and docs looking for a way to pick up
>> the link inside the <a href="http://www.ibm.com">thisLink</a> and pass
>> it from a mouse click in a text field.
>
> One way to accomplish the above is to write an HTML file to the drive
> and
> launch the file. This is a technique I use as a backup for launching
> a URL
> in a non-common browser (such as Earthlink's modified version of IE)
> and is
> roughly equivalent to double-clicking an HTML document on the desktop.
> It's
> not elegant, but it works.
>
> The following is a combination of scripts I use on Mac and Win
> platforms.
> You could add any HTML/Javascript code to the createHTML function to
> accomplish whatever result is desired.
>
> [ in a button script ]
<mtmlScript snip="I chopped your source code out"> HERE </mtmlScript>
> Regards,
>
> Scott Rossi
Scott,
Aren't you clever. I wouldn't have thought of that one. In Director I
wrote my own HTML parser that handled <a></a> links by creating arrays
of numerical char locations for all hyperlinks in a rendered text
field. I parsed out all the "http://..." codes and stored them in
arrays to be used if a hyperlink was clicked. I'm still hoping I won't
have to do this in Rev. <a link="http://www.someplace.com"> some text
</a> makes "some text" render as a hyperlink. I'm still learning how to
pick that link="http://www.someplace.com" up and use any stored
information that relates to each "some text" link clicked. I may be
wrong at this point but it looks like you need to make the hyperlink
the full URL, "http...," literally.
Mark
More information about the use-livecode
mailing list