Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Grabbing a DOM for use with Google Maps

    I am messing around with Google Maps a little and the fundamental difficulty in building anything useful is extrapolating address information from another website. I would like to be able to use a form like yahoo yellow pages send it a zip code and get back a bunch of, say, banks in that zip code and parse the address out. Some things, very few, actually return data in the XML format, but how do you write a script that send a request to a website and then returns that request as a DOM object. I'll even take HTML and then I'll parse it out myself, but how do you do that.

    I know it sounds fundamental, but I'm a real beginner in this, so if you can push me in the right direction I would appreciate it too. Thank you.

  • #2
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    You can use a client or serverside xmlhttp request, and "post" or "get" the form data to the specified url. If it's html data being returned in lieu of xml then you'll want to request the responseText of the xmlhttp object. It returns the html as a string, which is not navigable through the DOM, but I just added the string to a hidden div and then pulled out the nodes I wanted. It would be cool if there was some way to treat that string as you would when it was displayed by the browser so you wouldn't have to add unessary data to the page just to get the data you actually wanted displayed. Perhaps someone could help us both out. In any case here is a serverside example of what I'm reffering to:

    http://www.codingforums.com/showthread.php?t=69083

    This code is part of a client page that does a clientside request to this page which does a serverside request to an external url and then returns the results of the serverside request back to the client. Personally I think it's quite nifty.

    Basscyst
    Last edited by Basscyst; 10-13-2005 at 01:43 AM.
    Helping to build a bigger box. - Adam Matthews

  • #3
    Regular Coder
    Join Date
    Feb 2004
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm hearing some people say that I can't use a client-side xmlhttp request to another URL from my URL do you know anything about that? I'll have to try it out, but I'm getting some disparate information.

  • #4
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    I think that's right, you can't do it clientside to a different domain, but if you do it clientside to your server and then out to the other domain from your server, it is a plausable workaround.

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #5
    Regular Coder
    Join Date
    Feb 2004
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think I am starting to see. You need to have a client-side call to a server-side function say a PHP function or whatever which has to sit on the server I guess and then that php function can return the raw HTML at which point you can try to force it into a DOM or something.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •