[jQuery] Re: Selector Efficiency?

2009-03-02 Thread Josh Rosenthal
Hi Stephan,
Interesting.  You're also right that I could separate out the layerType
check.  I'm using a OCG WMS to fetch a small block of KML objects
surrounding a point (geoserver WMS with KML output).  In response to a user
query, I loop through the collection checking if the query coord is inside
any of the KML polygons.  If so, I use the jQuery we've been discussing to
harvest the details I care about from the KML description.  If not, I
requery using the user's new location.  Time for the kml query seems to be
~200-300 ms (as opposed to 30 seconds for a standard WFS query).

Of course in all likelihood, the operation occurs few enough times that the
speeds we've been discussing (just over 1 ms vs .2 ms) is relatively
meaningless when it comes to optimizing the full webapp as a whole. The
question was mostly a curiosity of what is most efficient/good habits.  In
this case, I suspect the pure JS route is a bad idea for this instance, as
the KML format has already changed once (tables to lists), and it may even
be that the hash table route would be preferable given how little this saves
in time.

My thanks!

Josh


On Mon, Mar 2, 2009 at 4:21 AM, Stephan Veigl wrote:

>
> Hi Josh,
>
> it looks like $foo.find(":header") has a problem since there is no
> single root element. Wrapping your data packet into  would help:
>  $foo = $(""+foo+"");
>
> but since you are after a speed optimization I would suggest:
>  layerType = $(queryTarget[0]).text();
> This gets the text of your first element, which is your header.
>
> One remark to the speed measurement:
> Do you get each packet from a different source type or do they came in
> streams from one source?
> If you have to do the layer look up for every packet, you have to
> account this time to your speed measurement as well.
>
> If you are really after high speed, you could use a pure JavaScript
> variant, which is about 25x faster than the original approach in IE.
> For that you would have to remove white spaces between your nodes, to
> avoid browser quirks.
>  var $foo = $(foo.replace(/>\s+<"));
> see: http://jsbin.com/ukewu
> But be warned, with this optimization you are hard coded to the
> current data packet layout and may not even change a point in it!
> This is a general remark: optimization goes against readability and
> flexibility in most cases.
> So you have to decide for every project and optimization step, what's
> worth more, speed vs. flexibility / scalability vs. readability /
> simplicity
>
> by(e)
> Stephan
>
>
>
> 2009/3/2 Josh Rosenthal :
> > Hi Stephen,
> > My apologies for not getting back to you sooner.  I've been sick and my
> > projects have gotten away from me.
> > We now return to the email I'd started writing before I lost track of
> > everything. 
> > Thank you!  Trebly so!
> > First, yes, the data is ordered based on a template in geoserver that
> > produces the KMLs.  Unfortunately, I'd simplified the issue in order to
> ask
> > my question.  There are actually two parcel sources, which each produce
> > different sets of fields.  The snippet I included above is from the low
> > quality parcels.  In the high quality parcels, MAP_ID becomes MAP_PAR_ID,
> > (hence my use of MAP_ as my search term).  Similarly, the indices change
> > depending on the layer.
> > However, I can detect which layer i'm using (listed in the header), so in
> > theory I could detect and then use indices appropriate to the layer.
> Mind
> > you, on trying this, I can't get $foo.find(":header").text(); to work, so
> > I'm not quite sure how to get it to work.  - http://jsbin.com/ujocousing
> > queryTarget for the second index attempt.
> > Given that the name of the fields change, I don't think I can use the
> hash
> > solution in any way other than the if layername == check that I was
> trying
> > before (which in any case requires a .find('header') to work).
> > Second, my thanks for the very cool site link.  Definitely great for
> sample
> > snippets.
> > Thirdly, the sample speed measurement code - one reason for the question
> in
> > the first place was not knowing how to measure speed.  The sample helps a
> > lot.
> > Thanks a lot, and sorry for the delay in responding,
> > Josh
> >
> > On Thu, Feb 19, 2009 at 5:12 AM, Stephan Veigl 
> > wrote:
> >>
> >> Hi Josh,
> >>
> >> are your data ordered? (e.g. MAP_ID is the first , SITE_ADDRESS
> >> the second, ...)
> >>
> >> If yes you can use a index based approach (from 4.8ms to 0.9ms on IE).
> >> var 

[jQuery] Re: Selector Efficiency?

2009-03-01 Thread Josh Rosenthal
Hi Stephen,
My apologies for not getting back to you sooner.  I've been sick and my
projects have gotten away from me.

We now return to the email I'd started writing before I lost track of
everything. 

Thank you!  Trebly so!

First, yes, the data is ordered based on a template in geoserver that
produces the KMLs.  Unfortunately, I'd simplified the issue in order to ask
my question.  There are actually two parcel sources, which each produce
different sets of fields.  The snippet I included above is from the low
quality parcels.  In the high quality parcels, MAP_ID becomes MAP_PAR_ID,
(hence my use of MAP_ as my search term).  Similarly, the indices change
depending on the layer.

However, I can detect which layer i'm using (listed in the header), so in
theory I could detect and then use indices appropriate to the layer.   Mind
you, on trying this, I can't get $foo.find(":header").text(); to work, so
I'm not quite sure how to get it to work.  - http://jsbin.com/ujoco using
queryTarget for the second index attempt.

Given that the name of the fields change, I don't think I can use the hash
solution in any way other than the if layername == check that I was trying
before (which in any case requires a .find('header') to work).

Second, my thanks for the very cool site link.  Definitely great for sample
snippets.

Thirdly, the sample speed measurement code - one reason for the question in
the first place was not knowing how to measure speed.  The sample helps a
lot.

Thanks a lot, and sorry for the delay in responding,

Josh

On Thu, Feb 19, 2009 at 5:12 AM, Stephan Veigl wrote:

>
> Hi Josh,
>
> are your data ordered? (e.g. MAP_ID is the first , SITE_ADDRESS
> the second, ...)
>
> If yes you can use a index based approach (from 4.8ms to 0.9ms on IE).
> var $foo = $(foo);
>var data = $foo.find(".atr-value");
>var parcelOutput = 'Parcel ID:  ' +
>$(data[0]).text() +
>'' +
>'Address:  ' +
>$(data[1]).text();
>
>
> Otherwise you can build a hash table of your name - value attributes
> and du a hash lookup (from 4.8ms to 2.7ms on IE)
> var $foo = $(foo);
>var names = $foo.find(".atr-name");
>var data = $foo.find(".atr-value");
>var hash = {};
>for (var j=0; jhash[$(names[j]).text()] = $(data[j]).text();
>}
>var parcelOutput = 'Parcel ID:  ' +
>hash['MAP_ID'] +
>'' +
>'Address:  ' +
>hash['SITE_ADDRESS'];
>
>
> see my examples on the profiling test page:
> http://jsbin.com/ifico/edit
>
> by(e)
> Stephan
>
>
> 2009/2/18 Josh Rosenthal :
> > So... a question regarding selector efficiency.
> > The following snippet of HTML describes attributes associated with a
> polygon
> > in an KML.  Its basically a table of data, contained as s in s
> in
> > a .  Given this snippet, what would be the best (fastest) way to
> return
> > the values of MAP_ID and SITE_ADDRESS
> > foo = "GISDATA.ASSESSPARNC_POLY_PUBLIC
> >
> > 
> >   MAP_ID:  > class="atr-value">16-27
> >   SITE_ADDRESS:  > class="atr-value">396 Main St
> >   SITE_OTHER_FIELD:
>  > class="atr-value">Grat Data
> >   USE_CODE:  > class="atr-value">101
> >   TOWN_ID:  > class="atr-value">116
> >class="atr-name">WARREN_GROUP_05_MAP_ID:
> > M:0016  B:  L:0027
> >   ACRES:  > class="atr-value">0.67102373655
> >
> > "
> >
> > The following works
> > parcelOutput = 'Parcel ID:  ' +
> >
> jQuery(foo).find('li:contains("MAP_")').not('li:contains("WARREN_GROUP")').children('.atr-value').text()
> > + '' + 'Address:  ' +
> >
> jQuery(foo).find('li:contains("SITE_ADDRESS")').children('.atr-value').text();
> > Is there a better/more efficient way to return these values?
> > Thanks!
>


[jQuery] Selector Efficiency?

2009-02-18 Thread Josh Rosenthal
So... a question regarding selector efficiency.
The following snippet of HTML describes attributes associated with a polygon
in an KML.  Its basically a table of data, contained as s in s in
a .  Given this snippet, what would be the best (fastest) way to return
the values of MAP_ID and SITE_ADDRESS

foo = "GISDATA.ASSESSPARNC_POLY_PUBLIC


  MAP_ID: 16-27
  SITE_ADDRESS: 396 Main St
  SITE_OTHER_FIELD: Grat Data
  USE_CODE: 101
  TOWN_ID: 116
  WARREN_GROUP_05_MAP_ID:
M:0016  B:  L:0027
  ACRES: 0.67102373655

"


The following works
parcelOutput = 'Parcel ID:  ' +
jQuery(foo).find('li:contains("MAP_")').not('li:contains("WARREN_GROUP")').children('.atr-value').text()
+ '' + 'Address:  ' +
jQuery(foo).find('li:contains("SITE_ADDRESS")').children('.atr-value').text();

Is there a better/more efficient way to return these values?

Thanks!


[jQuery] Re: Selecting a table cell based upon it's header?

2008-12-04 Thread Josh Rosenthal
To answer my own question, yes, I was.

jQuery("#myHeaders>th:eq("+idxCol+")").text());

Thanks!

On Thu, Dec 4, 2008 at 12:45 PM, Josh Rosenthal <[EMAIL PROTECTED]> wrote:

> Basically doing that, though using eq rather than nth-child.  However, I
> can't seem to get eq or nth-child to take a variable.
> When I do
> var idxCol = 3;
> jQuery("#myHeaders>th:eq(idxCol)").text();
> it returns nothing, while
> jQuery("#myHeaders>th:eq(3)").text();
> returns the header
>
> Same with nth-child (with nth-child removing the >th).
>
> Am I missing something obvious?
>
>
>
>
> On Thu, Dec 4, 2008 at 11:50 AM, brian <[EMAIL PROTECTED]> wrote:
>
>>
>> Once you loop through the headers and get the index position of a
>> particular one, you could select the nth child of the row.
>>
>> On Thu, Dec 4, 2008 at 11:23 AM, Josh Rosenthal <[EMAIL PROTECTED]>
>> wrote:
>> > Hi All,
>> > Hopefully this is a stupid question, and I just haven't been able to
>> find
>> > information about it.
>> > Given a table, with headers at the top.  I want to loop through the rows
>> of
>> > the table (easy), and loop through the elements of each row (easy), and
>> > based upon the values of those elements, construct a URL.
>> > If I set the headers as Property Name, is there any
>> way
>> > to then select the cells according to their header name?
>> > In theory, I guess I could first loop through the non header rows,
>> assigning
>> > each cell a classname according to the header row, and then when I
>> process
>> > each row to construct my url, I can select it according to the
>> classname.
>> > ... but it seems that there should be a better way.
>> > Any ideas?
>> >  Josh
>>
>
>


[jQuery] Re: Selecting a table cell based upon it's header?

2008-12-04 Thread Josh Rosenthal
Basically doing that, though using eq rather than nth-child.  However, I
can't seem to get eq or nth-child to take a variable.
When I do
var idxCol = 3;
jQuery("#myHeaders>th:eq(idxCol)").text();
it returns nothing, while
jQuery("#myHeaders>th:eq(3)").text();
returns the header

Same with nth-child (with nth-child removing the >th).

Am I missing something obvious?




On Thu, Dec 4, 2008 at 11:50 AM, brian <[EMAIL PROTECTED]> wrote:

>
> Once you loop through the headers and get the index position of a
> particular one, you could select the nth child of the row.
>
> On Thu, Dec 4, 2008 at 11:23 AM, Josh Rosenthal <[EMAIL PROTECTED]>
> wrote:
> > Hi All,
> > Hopefully this is a stupid question, and I just haven't been able to find
> > information about it.
> > Given a table, with headers at the top.  I want to loop through the rows
> of
> > the table (easy), and loop through the elements of each row (easy), and
> > based upon the values of those elements, construct a URL.
> > If I set the headers as Property Name, is there any
> way
> > to then select the cells according to their header name?
> > In theory, I guess I could first loop through the non header rows,
> assigning
> > each cell a classname according to the header row, and then when I
> process
> > each row to construct my url, I can select it according to the classname.
> > ... but it seems that there should be a better way.
> > Any ideas?
> >  Josh
>


[jQuery] Selecting a table cell based upon it's header?

2008-12-04 Thread Josh Rosenthal
Hi All,
Hopefully this is a stupid question, and I just haven't been able to find
information about it.
Given a table, with headers at the top.  I want to loop through the rows of
the table (easy), and loop through the elements of each row (easy), and
based upon the values of those elements, construct a URL.

If I set the headers as Property Name, is there any way
to then select the cells according to their header name?

In theory, I guess I could first loop through the non header rows, assigning
each cell a classname according to the header row, and then when I process
each row to construct my url, I can select it according to the classname.
... but it seems that there should be a better way.

Any ideas?

 Josh


[jQuery] Re: Image Display with Brightness Control?

2008-10-24 Thread Josh Rosenthal
Ouch.  Looking further, I guess IE has filters that can handle some similar
things  to  (ie: lighten, but not change brightness, etc), but I'll
attempt to find other solutions before we go that way (or just try to get
them to find someone to do it in flash).
Thanks muchly.
  josh

On Thu, Oct 23, 2008 at 4:51 PM, ricardobeat <[EMAIL PROTECTED]> wrote:

>
> Those kind of effects are only possible in Firefox through the use of
> the  element, which IE doesn't support. The only cross-browser
> ways do to it currently would be using Flash or processing the image
> server-side and reloading it.
>
>
> On Oct 23, 2:56 pm, "Josh Rosenthal" <[EMAIL PROTECTED]> wrote:
> > Hey Folks,
> > So, a project involving allowing users to view scanned photos of historic
> > structures has recently run into the problem that some of the photos are
> a
> > bit dark relative to the originals, with some details being impossible to
> > see in the jpg.  When viewed on desktop, this is usually dealt with by
> users
> > just tweaking the brightness in their quick and easy photo viewer of
> choice.
> >  I'm trying to replicate that functionality for a web interface we're
> > developing.
> >
> > Does anyone know of an image control jquery plugin that allows brightness
> > control, or has anyone dealt with similar issues?  Optimally, it'd be
> > something lightbox-esque, with FF3/IE7+ compatability, but I'd love to
> see
> > any examples at all.
> >
> > Poking around, I've found a few potential leads if I have to try to build
> > something, but I'm hoping someone out there has beaten me to it.
> >
> > In case anyone is curious, the leads I ran across were:
> > FF Only:http://people.mozilla.com/~schrep/image12.html
> > and:http://www.nihilogic.dk/labs/imagefx/
> > and lastly:
> > processing.js seems to have similar capabilities, but I've never done
> > anything with it and thus have no idea how easy/nightmarish it'd be to
> add a
> > brightness slider or +/-10% button to an image.  Also, compatibility is
> > problematic.
> >
> > Thanks a lot,
> >
> > josh
>


[jQuery] Image Display with Brightness Control?

2008-10-23 Thread Josh Rosenthal
Hey Folks,
So, a project involving allowing users to view scanned photos of historic
structures has recently run into the problem that some of the photos are a
bit dark relative to the originals, with some details being impossible to
see in the jpg.  When viewed on desktop, this is usually dealt with by users
just tweaking the brightness in their quick and easy photo viewer of choice.
 I'm trying to replicate that functionality for a web interface we're
developing.

Does anyone know of an image control jquery plugin that allows brightness
control, or has anyone dealt with similar issues?  Optimally, it'd be
something lightbox-esque, with FF3/IE7+ compatability, but I'd love to see
any examples at all.

Poking around, I've found a few potential leads if I have to try to build
something, but I'm hoping someone out there has beaten me to it.


In case anyone is curious, the leads I ran across were:
FF Only:
http://people.mozilla.com/~schrep/image12.html
and:
http://www.nihilogic.dk/labs/imagefx/
and lastly:
processing.js seems to have similar capabilities, but I've never done
anything with it and thus have no idea how easy/nightmarish it'd be to add a
brightness slider or +/-10% button to an image.  Also, compatibility is
problematic.


Thanks a lot,

josh


[jQuery] Re: cross domain XML with ajax

2008-09-24 Thread Josh Rosenthal
I'm in much the same boat.  I've been using openLayer's python based proxy,
but wouldn't mind seeing a more secured php based one, if you'd be willing
to post.   Of course, I'm currently limited to php4, so I may not be able to
use it, but... still curious.

Also, phil?, what are you querying against?  If Geoserver, it has tickets to
introduce jsonp to wfs-getfeature at some point, but its not there as yet.
 Andrea set the version as 1.7.1 (
http://jira.codehaus.org/browse/GEOS-1411).
Opening
a ticket or asking about outputformat=jsonp for getCapabilities would
probably be good thing.  Full jsonp support for the wms/wfs would be very
powerful.

-josh

On Tue, Sep 23, 2008 at 9:41 PM, Michael Geary <[EMAIL PROTECTED]> wrote:

>
> > I'm writing an OGC/WMS Viewer using jQuery.  One task I need
> > to accomplish involves making a getCapabilities request
> > against a Web Mapping Service, which responds with some XML.
> >
> > I know that the $.ajax function allows me to get JSON from
> > another domain, but is there a way to get XML from another
> > domain?  I've tried various permutations of data types, and
> > the $.ajax call with the "jsonp" call gets closest--it
> > returns the XML, but since it's not true JSON, the browser complains.
> >
> > Is my only option to use a proxy web service to access the XML?
>
> Yes, that is your only option, unless the web mapping service has the
> option
> to return JSONP (or any kind of executable JavaScript code) instead of XML.
>
> XMLHttpRequest is limited to the same-domain rule.
>
> Script tags/elements are not. You can load a script tag or element from any
> URL.
>
> Cross-domain JSONP is simply a way to wrap up JSON data inside a piece of
> executable JavaScript code, so that it can be loaded in a script
> tag/element
> instead of through XMLHttpRequest.
>
> Do you need some code for a simple PHP proxy? It's only a few lines of
> code.
> Give me a shout if you need it and I'll post the one I use - otherwise just
> search for "php proxy" and you'll find some. Or you can find similar code
> for any server language.
>
> Just watch out that you don't run an open proxy inadvertently! Burn the
> address of the web mapping service into the proxy server's requests, so
> people can't use it for nefarious purposes.
>
> -Mike
>
>


[jQuery] Re: multiple getJSON calls appear to wait for first response to run any callbacks in FF?

2008-09-17 Thread Josh Rosenthal
Sorry for not following up... looks like I missed your response while I was
away.
However, I'm reasonably sure I don't understand.  It doesn't seem like
getJSON is supposed to wait... wraps with the callback function, and thus
should run when there is a return.  Can you give a bit more detail, or point
me to an similar structure as what you describe?

Thanks!
josh

On Sat, Sep 6, 2008 at 8:36 AM, Rene Veerman <[EMAIL PROTECTED]> wrote:

> don't wait for any response, just poll an array of 'open' responses and
> handle whichever are ready?
>
>
> On Thu, Sep 4, 2008 at 3:13 PM, Josh Rosenthal <[EMAIL PROTECTED]> wrote:
>
>> Hey all,
>> I'm building a google map based application which allows users to query a
>> number of different json returning data lookup services  (ie: get Tax Parcel
>> for this coordinate... get address, get USGS Quad Name, get Place Name).
>>  Each service is activated by clicking a different button, etc.  While some
>> of these queries run pretty fast, others (parcels), take ~ 30-40 seconds.
>>  Working in Firefox 3, I've found that once a user runs the slow getJSON,
>> none of the other queries will run their callback, until that slow getJSON
>> finishes.  However, when I watch in firebug, I can see that we've actually
>> queried and gotten a valid, wrapped response, and we're just waiting to
>> process it.  Basically, the jsonp calls may be asynchronous, but we get a
>> bottleneck where we're waiting for the response to one jsonp call, but
>> already get the answer to another, and yet have to wait til the first
>> returns in order to do our second callback.
>>
>> IE7 appears to display more correct behaviour, with the callbacks firing
>> in the order that responses are received.
>>
>> Any suggestions as to how to get FF3 to behave similarly?
>>
>> -Josh
>>
>
>


[jQuery] multiple getJSON calls appear to wait for first response to run any callbacks in FF?

2008-09-04 Thread Josh Rosenthal
Hey all,
I'm building a google map based application which allows users to query a
number of different json returning data lookup services  (ie: get Tax Parcel
for this coordinate... get address, get USGS Quad Name, get Place Name).
 Each service is activated by clicking a different button, etc.  While some
of these queries run pretty fast, others (parcels), take ~ 30-40 seconds.
 Working in Firefox 3, I've found that once a user runs the slow getJSON,
none of the other queries will run their callback, until that slow getJSON
finishes.  However, when I watch in firebug, I can see that we've actually
queried and gotten a valid, wrapped response, and we're just waiting to
process it.  Basically, the jsonp calls may be asynchronous, but we get a
bottleneck where we're waiting for the response to one jsonp call, but
already get the answer to another, and yet have to wait til the first
returns in order to do our second callback.

IE7 appears to display more correct behaviour, with the callbacks firing in
the order that responses are received.

Any suggestions as to how to get FF3 to behave similarly?

-Josh


[jQuery] a couple jGrowl tweaks

2008-09-03 Thread Josh Rosenthal
Hey Folks,
So... faced with the challenge of how to elegantly display query results on
top of a google map (queries from assorted data services, such as geonames,
etc), I settled on jGrowl.  The look was right, the controls were right...
just a few things I needed to tweak.  I figured I'd post the problems and
solutions in case they're of use to anyone, and in hopes that if someone
knows of a better way to accomplish the same, they might offer advice, as
I'm still rather new to all of this.

So...

0) Retarget jGrowl towards a customDiv with customJGClass.  customJGClass is
then positioned overtop the map.

1) We need to limit how much space jGrowl can take up on the map.  Overflow
could work, but is awkward, ugly, or inelegant.  Better would be if we
simply limit the number of Growls that can appear in the customDiv jGrowl.
 To do this, we use jGrowl's beforeOpen function as follows.

var checkGrowlLimit= function (e,m,o) {
var queryResultsObj =this.find('.jGrowl-notification').slice(1);  //
skip the spaceholder
if (queryResultsObj.length > (o.maxGrowls || 6) ) {

 
queryResultsObj.eq(0).children('div.close').unbind('click.jGrowl').parent().remove();
}
}

and use jQuery('#customDiv').jGrowl('A
message!',{sticky:true,beforeOpen:checkGrowlLimit});

This also supports adding a new option of maxGrowls.

Problems:
* If we try to make that a while loop, such that setting maxGrowls of 2
would prune away the extra additional growls...  it crashes FF3.  I'm sure
theres an obvious reason why, but I'm missing it.

* We can't support animation on the checkGrowlLimit, because if we used the
closing animations, then spamming the Growler would result in the same growl
being targetted for destruction multiple times... in other words, we could
spam past the limit.

2) However, some of these jsonp queries are multi tiered and take 30-40
seconds.  (Parcel queries, through a geoserver web feature server... first
we query a parcel status layer, response determines if there is data, and if
so, where we should look for it).  Thats entirely too long to go without
showing the user that something is actually happening.  Therefore, we'd like
to show a message or spinner of some brand or another in a Growl, and then
replace it with our data, once the json arrives.

But how can we target a specific Growl?  To do this, we will make use of the
jGrowl's theme options.  Setting a theme simply sets a class for the jGrowl.
 id might be better, but I don't know of any way to set the id of a Growl,
so we'll have to make do with class.

function queryWithFeedback() {
var d = new Date();
var constant = 'arbClass_' +d.getTime() ;

 . {sticky:true,beforeOpen:checkGrowlLimit,theme:constant + ' default'}

makes for a reliably unique class.
After that, once our final query returns, we just declare the growl once,
and then

  jQuery('#customDiv').find('.'+constant).find('.message').text('Our
new message!');

Problems
* close and beforeClose will use the original message rather than the new
one.

In any case, those are the tweaks.  They work, but I suspect there are
better ways of handling the issues, and would welcome any feedback/advice.

Thanks!

 Josh


[jQuery] Re: Getting name of element in $.each, when used on object?

2008-08-24 Thread Josh Rosenthal

And... yeah.  That does it.  Embarrassing, but I guess I've not used
for..in before, and didn't realize what it did.  I do now :-)

Much obliged.

On Aug 24, 9:13 am, Evan <[EMAIL PROTECTED]> wrote:
> Try this:
>
> var i = 0;
> var s = '';
> for (var prop in o)
> {
>    if (i > 0)
>       s += '&';
>
>    s += prop + '=' + o[prop];
>    ++i;}
>
> alert(s);
>
> On Aug 24, 5:12 pm, "Josh Rosenthal" <[EMAIL PROTECTED]> wrote:
>
> > Hey Folks,
>
> > Probably a rather basic question here, but my attempts at figuring it out
> > have come to no success.
>
> > I'm using $.each to loop through the attributes of an object, and write them
> > out into a string.  The object contains a series of parameters that will be
> > passed through a url (for a geoserver WFS should anyone care).  Is there any
> > way to get the name of the attribute so that it can be used as a string?
>
> > Mockup object:
> > {
> >    request: "getfeature",
> >    typename: "massgis:TOWNS",
> >    propertyname: "TOWN_ID,PARCEL_STATUS",
> >    cql_filter: "INTERSECT(SHAPE,POINT(-72.22%2041.00)"
>
> > }
>
> > Goal is to generate something like
> > &request=getfeature&typename=massGIS:TOWNS&propertyname=
>
> > Unfortunately, I can't seem to get 'request' and 'typename' etc.  Anything
> > obvious I'm missing, or is this truly impossible?
>
> > Thanks a lot,
> >  Josh


[jQuery] Getting name of element in $.each, when used on object?

2008-08-24 Thread Josh Rosenthal
Hey Folks,

Probably a rather basic question here, but my attempts at figuring it out
have come to no success.

I'm using $.each to loop through the attributes of an object, and write them
out into a string.  The object contains a series of parameters that will be
passed through a url (for a geoserver WFS should anyone care).  Is there any
way to get the name of the attribute so that it can be used as a string?

Mockup object:
{
   request: "getfeature",
   typename: "massgis:TOWNS",
   propertyname: "TOWN_ID,PARCEL_STATUS",
   cql_filter: "INTERSECT(SHAPE,POINT(-72.22%2041.00)"
}

Goal is to generate something like
&request=getfeature&typename=massGIS:TOWNS&propertyname=

Unfortunately, I can't seem to get 'request' and 'typename' etc.  Anything
obvious I'm missing, or is this truly impossible?

Thanks a lot,
 Josh