Pass A URL w/Javascript

Monte Goulding monte at sweattechnologies.com
Tue Aug 12 20:53:01 EDT 2003


> <p> <a href="http:// and the cat chased the dog">Cat & Dog </a> </p>
> <p> <a href="http type=sound linkauto=intro.swa buffer=5 size=40
> next=yes">mtmlsound link</a></p>
> <p><a href="http type=image linkauto=image2.gif
> location=side">mtmlimage link</a> </p>
> <p><a href="http type=video linkauto=comeWithMe.mov next=yes
> location=side">mtmlvideo link</a></p>
>
> This is definitely not SQML compliant but having your own markup
> language "means never having to say you're sorry."
>
> This just saved me from having to write the algorithm from hell. I
> might just go out and take a day off for this. Yippee!
>
Hey mark

You don't need the http bit at the start of the linkText.

I'd also suggest using = to separate name, value pairs and & to separate
items as with a CGI url. Then you can just:

put urlDecode(pLink) into tLink
split tLink by "&" and "="
if tLink[type] = "video" then
  set the fileName of player x to tLink[linkauto]
end if

Cheers

Monte




More information about the use-livecode mailing list