Second off, is this a stupid way of achieving what I want to do?

"Stupid" is a rather strong word, but yes, it is an ill-advised approach. Let's assume you sort out the particulars of issuing requests to a server for more data without moving off of the current page. (This can be done, with hidden frames and Javascript.) The killer will be performance.

Dynamically requesting new data as the mouse wanders over an images is a viable approach for a fat UI that has a short and fast pipe to underlying data, but for a web-based application, performance is going to SUCK. The lag between determining that you need to fetch data for more cities and that data being available in the browser will driver your users up the wall. (It did to our users when we tried something similar.)

I think your best bet is to generate a fatter page initially, with city data in Javascript data structures that you can query in the browser.


In reply to Re: Calling a perl function from within a javascript function by dws
in thread Calling a perl function from within a javascript function by Baz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.