hello guys i am up to a task. i want to add a functionality to my form that when the city in given in the address field it can be viewed in google map application.For this i had found design a image so that when location is specified in the city field..that image hyper link can click if the person want to see the city location in the map.i found a code related to this in vb scrpit.Can some help me out that how could i write it in javascript.

Function OpenMap(Address, City, State, Zip, Country)

    Dim strAddress As String
    strAddress = Nz(Address)
    strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(City)
    strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(State)
    strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(Zip)
    strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(Country)
    
    If strAddress = "" Then
        MsgBox "There is no address to map."
    Else
        Application.FollowHyperlink "http://maps.live.com/default.aspx?where1=" & strAddress
    End If
End Function

i have another question that can we use Application.FollowHyperlink in javascript.

i come up this code in javascript.i known this not write but can any body correct it

<script language="javascript">
   function OpenMap(Address, City, State, Zip, Country)

    Dim var strAddress As String
    strAddress = Nz(Address)
    strAddress = strAddress & if(strAddress = "", "", ", ") & Nz(file)
    strAddress = strAddress & if(strAddress = "", "", ", ") & Nz(State)
    strAddress = strAddress & if(strAddress = "", "", ", ") & Nz(Zip)
    strAddress = strAddress & if(strAddress = "", "", ", ") & Nz(Country)
    
    If(strAddress=="") 
	{
        document.write("There is no address to map.");
	}
	else
       <a href="http://maps.live.com/default.aspx">click me</a>;
    }



</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.