Mac Forums

Mac Forums (
-   Web Design and Hosting (
-   -   Help with JavaScript and PhoneBook widget (

garymm 06-09-2005 03:07 AM

Help with JavaScript and PhoneBook widget
For starters, I have very limited experience with JavaScript. That out of the way, I want to modify the phonebook widget so that when I click on an address, I get directions to it rather than a map of it. The pertinent section of PhoneBook.js (or at least this is the only thing that I think is pertinent but I have no idea how to use javascript) follows (can be accessed via the "show package contents" on the PhoneBook widget file in Library/Widgets):

var mapURL = "";

mapURL += URLEncode( singleResult.address );
mapURL += "&city=";
mapURL += URLEncode( );
mapURL += "&state=";
mapURL += URLEncode( singleResult.state );
mapURL += "&zip=";
mapURL += URLEncode( );

addressSpansContainer.setAttribute("maplink", mapURL );
addressSpansContainer.onclick = function(event)
if( window.widget )

Here are the mapquest guidelines for creating a link to directions (instead of a map): link

I can figure out how to simply enter my home address into the base URL and have it permanently stored in the PhoneBook.js, but what I really want is a way to make it check my address from my card in Address Book. Is there a way to do this with JavaScript or at all?

Thanks for the help. I will definitely share the edited widget.

All times are GMT -4. The time now is 04:22 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.