tricky javascript situation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • iceanfire

    tricky javascript situation

    On the backend I have a python script that gets two pieces of
    information from the database:
    1. html
    2. xml file

    The javascript is supposed to :
    1. inject the html file into a div
    2. use the xml file to create markers on google maps

    I want to avoid multiple calls to the database, so I was wondering, if
    there was anyway I could get javascript to recieve both files at once
    from python (and if it was possible for python to send two files in
    one request).

    I hope that makes sense, I didn't really know how to summarize it for
    a brief subject line :-/

    thanks in advance!
  • Thomas 'PointedEars' Lahn

    #2
    Serving HTML and XML for Google Maps in one response (was: trickyjavascrip t situation)

    iceanfire wrote:
    On the backend I have a python script that gets two pieces of
    information from the database:
    1. html
    2. xml file
    >
    The javascript is supposed to :
    1. inject the html file into a div
    2. use the xml file to create markers on google maps
    >
    I want to avoid multiple calls to the database, so I was wondering, if
    there was anyway I could get javascript to recieve both files at once
    from python (and if it was possible for python to send two files in
    one request).
    You could embed the HTML markup declared as CDATA in the XML markup.
    I hope that makes sense, I didn't really know how to summarize it for
    a brief subject line :-/
    That's a pity.


    PointedEars
    --
    Use any version of Microsoft Frontpage to create your site.
    (This won't prevent people from viewing your source, but no one
    will want to steal it.)
    -- from <http://www.vortex-webdesign.com/help/hidesource.htm>

    Comment

    • Sister Ray

      #3
      Re: Serving HTML and XML for Google Maps in one response (was: trickyjavascrip t situation)

      On Sep 21, 11:08 am, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
      wrote:
      iceanfire wrote:
      On the backend I have a python script that gets two pieces of
      information from the database:
      1. html
      2. xml file
      >
      The javascript is supposed to :
      1. inject the html file into a div
      2. use the xml file to create markers on google maps
      >
      I want to avoid multiple calls to the database, so I was wondering, if
      there was anyway I could get javascript to recieve both files at once
      from python (and if it was possible for python to send two files in
      one request).
      >
      You could embed the HTML markup declared as CDATA in the XML markup.
      >
      I hope that makes sense, I didn't really know how to summarize it for
      a brief subject line :-/
      >
      That's a pity.
      >
      PointedEars
      --
      Use any version of Microsoft Frontpage to create your site.
      (This won't prevent people from viewing your source, but no one
      will want to steal it.)
        -- from <http://www.vortex-webdesign.com/help/hidesource.htm>
      You could make the to calls, and join the result in a single XML:
      <2callsin1>
      <xmldata>...... </ xmldata>
      <htmldata>..... </ htmldata>
      </ 2callsin1>

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Serving HTML and XML for Google Maps in one response

        Sister Ray wrote:
        Thomas 'PointedEars' Lahn wrote:
        >iceanfire wrote:
        >>On the backend I have a python script that gets two pieces of
        >>information from the database:
        >>1. html
        >>2. xml file
        >>The javascript is supposed to :
        >>1. inject the html file into a div
        >>2. use the xml file to create markers on google maps
        >>I want to avoid multiple calls to the database, so I was wondering, if
        >>there was anyway I could get javascript to recieve both files at once
        >>from python (and if it was possible for python to send two files in
        >>one request).
        >You could embed the HTML markup declared as CDATA in the XML markup.
        ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^
        >[...]
        >
        You could make the to calls, and join the result in a single XML:
        <2callsin1>
        <xmldata>...... </ xmldata>
        <htmldata>..... </ htmldata>
        </ 2callsin1>
        What is your purpose in just reiterating what I said, but in gibberish and
        invalid code, while foolishly continuing to quote signatures, despite my
        previous explicit asking you to stop doing that?


        Score adjusted

        PointedEars
        --
        Prototype.js was written by people who don't know javascript for people
        who don't know javascript. People who don't know javascript are not
        the best source of advice on designing systems that use javascript.
        -- Richard Cornford, cljs, <f806at$ail$1$8 300dec7@news.de mon.co.uk>

        Comment

        • optimistx

          #5
          Re: Serving HTML and XML for Google Maps in one response

          Thomas 'PointedEars' Lahn wrote:
          ....
          What is your purpose in just reiterating what I said, but in
          gibberish and invalid code, while foolishly continuing to quote
          signatures, despite my previous explicit asking you to stop doing
          that?
          >
          >
          Score adjusted
          >
          PointedEars
          Would you pleas explain, what you mean by 'Score adjusted'?

          What happens to you, if the signature is quoted? Do you become
          ill, angry, get headace or something else? You have repeated
          your command 'do not quote signatures' many times, so I might
          help here somewhat:

          'do not quote signatures'
          'do not quote signatures'
          'do not quote signatures'
          'do not quote signatures'
          'do not quote signatures'


          Comment

          Working...