Tuesday, September 30, 2008

[jQuery] Re: stripping style from ajax html

Hi Prajwala,

Well that kind of worked. I ended up doing this:
data = $(data);
var replace = $('<div></div>');
data.each( function() {
if (
this.tagName != 'STYLE'
&& this.tagName != 'SCRIPT'
&& this.tagName != 'COMMENT'
) {
replace.append( this );
}
} );

I could not get the remove() function to behave as expected. Perhaps
I need to remove all children tags first or something like that?
Anyway this got me the desired results! Thanks!

cRRRum

On Sep 30, 12:47 am, "Prajwala Manchikatla" <m.prajw...@gmail.com>
wrote:
> I tested with this html
> t =
> $('<html><head><style>.sssss{color:red}</style><script>function(){alert("hi")}</script></head><body>ssss</body></html>')
>
> The return value is jquery object with 3 elements.
> when I do t.get(0) it return style tag
> when I do t.get(1) it return script tag
> when I do t.get(2) it return just "ssss" the content of the body tag
>
> So what happened is the jquery did not consider the html, head, body tags.
> It just created style, script and the content of the body tag with the text
> element.
>
> so you can do like this
> t.each(function(){
> if (this.tagName == 'STYLE'){
> $(this).remove();
> return;
> }
> if(this.tagName == 'SCRIPT'){
> $(this).remove();
> }
>
> })
>
> so it will remove the style and script tags.
>
> cheers,
> Prajwala
>
> On Mon, Sep 29, 2008 at 11:24 PM, crrrum <roy....@gmail.com> wrote:
>
> > Hello all,
>
> > I have a webapp displaying email which can sometimes contain HTML
> > message bodies. I use jquery's .ajax method to grab an HTML message
> > body and then put it into a div tag. Problem is if the HMTL contains
> > style or script tags I get unwanted results.
>
> > I've tried $( html ).find( 'style' ).remove(). This will remove the
> > the actual <style> and </style> tags but still leaves the style text
> > itself inside. I tried several variations but I just can't seem to
> > get this to remove the actual style text with the style tags. Any way
> > to do this or will I have to do a bunch of custom search and replaces?
>
> > Thanks in advance,
> > cRRRum

[jQuery] Re: cite jquery

Thanks.

I also plan to publish in an article in a scientific journal. Is
there an official publication for JQuery I can cite? Or do I just
site it by URL?

Vince

On Sep 29, 3:11 pm, "Andy Matthews" <li...@commadelimited.com> wrote:
> Footer link would probably be nice, or a "credits" page in the footer, or
> even in your source code.
>
> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com] On
>
> Behalf Of forgetta
> Sent: Monday, September 29, 2008 10:16 AM
> To: jQuery (English)
> Subject: [jQuery] cite jquery
>
> Hi all,
>
> I am using JQuery in a web application I plan to publish.  How do I cite
> JQuery?
>
> Thanks.
>
> Vince

[jQuery] Re: cite jquery

Thanks.

I also plan to publish in an article in a scientific journal. Is
there an official publication for JQuery I can cite? Or do I just
site it by URL?

Vince

On Sep 29, 3:11 pm, "Andy Matthews" <li...@commadelimited.com> wrote:
> Footer link would probably be nice, or a "credits" page in the footer, or
> even in your source code.
>
> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com] On
>
> Behalf Of forgetta
> Sent: Monday, September 29, 2008 10:16 AM
> To: jQuery (English)
> Subject: [jQuery] cite jquery
>
> Hi all,
>
> I am using JQuery in a web application I plan to publish.  How do I cite
> JQuery?
>
> Thanks.
>
> Vince

[jQuery] Re: Set height of element depending on only on its own position and window height?

Thanks for your input, your demo is actually working better than what
I came up with, I'm gonna look into it and see if I can use it.

Absolute positioning would normally work but not in my case. This
function is to be a part in a web based user interface for a very
large business application, and the html framework includes a
gazillion positioned elements to make the app stretch to the whole
viewport, and it has a collapsible left search and menu section, so
absolute positioning would mess with a lot of other stuff...

This is actually a holder for a search result table, where the table
header is fixed and the body is scrolling, and I cannot set any
heights or widths manually. Widths do themselves pretty good, but in
order to get a pixel hiehgt value that would go from the start of the
table and take up the rest of the viewport, this is the way to go. I'm
also setting the table width to the div's auto width minus 20px to
accommodate for the scrollbar.

Also, I use a similar function for Firefox, but since firefox scrolls
the tbody element nicely if you set it to a fixed height, I target
that instead. And since FF stretches the tbody to this fixed height
even if there's too few rows, I have to compare the actual height
with:
$("tbody").height() with the full viewport height which is window
height minus top offset minus thead height and a bogus tfoot div
height and 20px bottom spacer. Which ever is the lowest vaule is
applied to the tbody, works like a charm :-))

All left now is the left search/menu collapse coltroller for this and
Im all set. Thanks again for your help!

/Torgil - kabelkultur.se


On 30 Sep, 21:06, rolfsf <rol...@gmail.com> wrote:
> I might add that you may be able to accomplish the same thing in
> 'modern' browsers (e.g. not IE6) with just css, using absolute
> positioning. Just set your right, left and bottom to, for example,
> 10px. (IE6 can't handle positioning on 3 sides).
>
> On Sep 30, 11:58 am, rolfsf <rol...@gmail.com> wrote:
>
>
>
> > Glad you solved it. I actually had a mistake in my last line, but
> > here's a working version:
>
> >http://www.monkeypuzzle.net/testfiles/jquery/divSize.htm
>
> > I added a window resize function so it always adapts to the window. As
> > you can see, nothing is absolutely positioned, and I threw a mixture
> > of elements above the div I wanted to size, just to confirm that it
> > really doesn't care what's there - it's measuring the offset from the
> > top of the window.
>
> > On Sep 30, 3:26 am, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
>
> > > Well, I managed to solve it.
>
> > > Using option relativeTo for the offset and setting the relativeTo to
> > > use my header div that is always present, and always absolutely
> > > positioned at top:0;
>
> > > Now I have a div that takes up whatever space is left down to bottom
> > > of viewport, just like I wanted. Thanks for all help!
>
> > > On 30 Sep, 10:18, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
>
> > > > Well, thanks, but it turns out that it does exactly the same as my own
> > > > function.
> > > > If I have a div above it with a SET TOP position, e.g. css: top:0; -
> > > > or whatever - it works.
> > > > But if I don't have nothing but a bunch of <br/> tags above the div,
> > > > or if I set the div above to psition:relative and remove the set top
> > > > position, it doesn't work anymore.
> > > > I really need some way to get the top offset for my div from the top
> > > > edge of the window, no matter what may or may not be above the div in
> > > > the DOM tree, and so far no luck.
> > > > But thanks for the effort, I appreciate it.
>
> > > > /Torgil
>
> > > > On 29 Sep, 21:26, rolfsf <rol...@gmail.com> wrote:
>
> > > > > try this:
>
> > > > > var wh = $(window).height();                            // window height
> > > > > var mt = $('#myDiv').offset().top;                              // top position of #myDiv
>
> > > > > $(mt).css('height', wh - mt - 20 + 'px');                       // set height of #myDiv
>
> > > > > On Sep 29, 8:33 am, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
>
> > > > > > Well, the $(window).height() gets the height for me.
>
> > > > > > What I need is something to measure the distance from the window top
> > > > > > and down to the element top.
> > > > > > And then subtract it from the window height, minus another 20 pix ad
> > > > > > use that value as height for the div.
>
> > > > > > If the window is 1000 px high, and the div starts 300px down, I'd like
> > > > > > to get 100 - 300 - 20 = 680
> > > > > > And then apply this as height for the div.
>
> > > > > > And this needs to be done without mixing in other elements that might
> > > > > > or might not be part of the dom tree between the window top and the
> > > > > > elements top position.
>
> > > > > > So I guess that the problem lies within the second measuring parameter
> > > > > > of my function:
> > > > > >    $ (".tableHolder").offset().top - this for some reason uses other
> > > > > > positioned elements for its calculation, and I need it not to.
>
> > > > > > Regards, Torgil - kabelkultur.se- Dölj citerad text -
>
> > > > > - Visa citerad text -- Dölj citerad text -
>
> > > > - Visa citerad text -- Dölj citerad text -
>
> - Visa citerad text -

[jQuery] Re: Insert content in row

Wonderful!!! Thanx

p.s.: to avoid several appended content I used:                  $( '#' + this.id + '_injected' ).html('');

On Tue, Sep 30, 2008 at 3:39 PM, BB <buchholz.bastian@googlemail.com> wrote:

Try this:
$('.rowContent').click(function(){
 var row = this;
 $.get("getCountryContent.cfm", { u: row.id }, function(data){
   // this == the options for this ajax request
   var $conteudo = trim12( data );
   alert("Data Loaded: " + $conteudo);
   $( '#' + row.id ).append( $conteudo );
 });
});

http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype

On 30 Sep., 20:27, "Web Specialist" <especialista...@gmail.com> wrote:
> Hi all. I have this very simple content:
>
> <tr>
>     <td class="rowContent" id="902_1200_2008">United States</td>
> </tr>
> <tr>
>     <td class="rowContent" id="104_500_2008">Canada</td>
> </tr>
>
> When user clicks in any row i'll want to display the details about that row.
> I'm using this but without success:
>
> $('.rowContent').click(function(){
> $.get("getCountryContent.cfm", { u: this.id },
>   function(data){
>   var $conteudo = trim12( data );
>     alert("Data Loaded: " + trim12( data ));
>     $( '#' + this.id ).html(trim12( data )).append();
>   });
>
> });
>
> This ajax response is an html table...
>
> What's wrong?
>
> Cheers
> Marco Antonio

[jQuery] Re: Select multiple iterating over selections from database

hmmm, would be more straight up js than jQuery

if you had:

<select id="Users" selection="multiple">
<option value="1">Bob</option>
<option value="2">Doug</option>
<option value="3">Jake</option>
<option value="4">Steve</option>
<option value="5">Mike</option>
<option value="6">John</option>
<select>


//values from database in some enumerable object
var vfdb = new Array("1", "4", "6");

//loop and set
var lst = $("Users")[0];
for (var i=0; i < lst.options.length; i++) {
for (var j=0; j < vfdb.length; j++) {
if (lst.options[i].value == vfdb[j]) {
lst.options[i].selected == true;
break;
}
}
}


of course that could be included in the success callback of some sort
of $.ajax call or whatever


On Sep 30, 9:51 am, "Allen Schmidt" <allen...@gmail.com> wrote:
>  Greetings,
> If I have a select multiple set up with say 10 items, and I am making a pass
> over them from a call to a database that returns some of those values (more
> than one), how can I check to see if an option in the select is one of the
> items returned from the database and select it also?
> Thanks!
>
> Allen

[jQuery] Re: Set height of element depending on only on its own position and window height?

I might add that you may be able to accomplish the same thing in
'modern' browsers (e.g. not IE6) with just css, using absolute
positioning. Just set your right, left and bottom to, for example,
10px. (IE6 can't handle positioning on 3 sides).

On Sep 30, 11:58 am, rolfsf <rol...@gmail.com> wrote:
> Glad you solved it. I actually had a mistake in my last line, but
> here's a working version:
>
> http://www.monkeypuzzle.net/testfiles/jquery/divSize.htm
>
> I added a window resize function so it always adapts to the window. As
> you can see, nothing is absolutely positioned, and I threw a mixture
> of elements above the div I wanted to size, just to confirm that it
> really doesn't care what's there - it's measuring the offset from the
> top of the window.
>
> On Sep 30, 3:26 am, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
>
> > Well, I managed to solve it.
>
> > Using option relativeTo for the offset and setting the relativeTo to
> > use my header div that is always present, and always absolutely
> > positioned at top:0;
>
> > Now I have a div that takes up whatever space is left down to bottom
> > of viewport, just like I wanted. Thanks for all help!
>
> > On 30 Sep, 10:18, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
>
> > > Well, thanks, but it turns out that it does exactly the same as my own
> > > function.
> > > If I have a div above it with a SET TOP position, e.g. css: top:0; -
> > > or whatever - it works.
> > > But if I don't have nothing but a bunch of <br/> tags above the div,
> > > or if I set the div above to psition:relative and remove the set top
> > > position, it doesn't work anymore.
> > > I really need some way to get the top offset for my div from the top
> > > edge of the window, no matter what may or may not be above the div in
> > > the DOM tree, and so far no luck.
> > > But thanks for the effort, I appreciate it.
>
> > > /Torgil
>
> > > On 29 Sep, 21:26, rolfsf <rol...@gmail.com> wrote:
>
> > > > try this:
>
> > > > var wh = $(window).height();                            // window height
> > > > var mt = $('#myDiv').offset().top;                              // top position of #myDiv
>
> > > > $(mt).css('height', wh - mt - 20 + 'px');                       // set height of #myDiv
>
> > > > On Sep 29, 8:33 am, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
>
> > > > > Well, the $(window).height() gets the height for me.
>
> > > > > What I need is something to measure the distance from the window top
> > > > > and down to the element top.
> > > > > And then subtract it from the window height, minus another 20 pix ad
> > > > > use that value as height for the div.
>
> > > > > If the window is 1000 px high, and the div starts 300px down, I'd like
> > > > > to get 100 - 300 - 20 = 680
> > > > > And then apply this as height for the div.
>
> > > > > And this needs to be done without mixing in other elements that might
> > > > > or might not be part of the dom tree between the window top and the
> > > > > elements top position.
>
> > > > > So I guess that the problem lies within the second measuring parameter
> > > > > of my function:
> > > > >    $ (".tableHolder").offset().top - this for some reason uses other
> > > > > positioned elements for its calculation, and I need it not to.
>
> > > > > Regards, Torgil - kabelkultur.se- Dölj citerad text -
>
> > > > - Visa citerad text -- Dölj citerad text -
>
> > > - Visa citerad text -

[jQuery] Re: select data in a

ignoring the

NodeType Named Constant
1 ELEMENT_NODE
2 ATTRIBUTE_NODE
3 TEXT_NODE
4 CDATA_SECTION_NODE
5 ENTITY_REFERENCE_NODE
6 ENTITY_NODE
7 PROCESSING_INSTRUCTION_NODE
8 COMMENT_NODE
9 DOCUMENT_NODE
10 DOCUMENT_TYPE_NODE
11 DOCUMENT_FRAGMENT_NODE
12 NOTATION_NODE

from: http://www.w3schools.com/Dom/dom_nodetype.asp

I had to check for nodeType == 3 since the text nodes do not have an
innerHtml property. Also, after some reading, I think 'node.nodeValue'
would be more "proper" over 'node.data'

I'd like to see how you get it to work better with jQuery, or rather,
"native jQuery". I'll try it myself, but I'd like to see how others
would implement it.


On Sep 30, 2:20 pm, Pedram <pedram...@gmail.com> wrote:
> Wow amazing... it worked let me ask you question I think I can do it
> with jQuery ..
> do you know what does node.nodeType mean in javascript
> nodeType=1 what does that mean for each value ?
> thanks Pedram
>
> On Sep 30, 8:29 pm, equallyunequal <equallyuneq...@gmail.com> wrote:
>
> > I'm not sure how to do it in a "jQuery" way. But here's what I came up
> > with:
>
> > $( function(){
> >         $("p").each( function() {
> >                 var allButSpan = this.allButSpan = new Array();
> >                 $.each(this.childNodes, function(i, node) {
> >                         if (node.nodeName.toLowerCase() != "span")
> > { allButSpan[allButSpan.length] = node; }
> >                 });
> >         });
>
> >         $("p").each( function(){
> >                 var innerHtml = "";
> >                 $.each(this.allButSpan, function(i, node) { innerHtml +=
> > (node.nodeType == 3) ? node.data : $(node).html(); } );
> >                 console.log(innerHtml);
> >         });
>
> > });
>
> > Example here:http://joeflateau.net/playground/testingpexcspan.html
>
> > You need Firebug (or anything that supports console.log) to use the
> > example!
>
> > On Sep 30, 12:20 pm, Pedram <pedram...@gmail.com> wrote:
>
> > > It didn't work Cause the Text isn't concern as a Children and it is in
> > > No Tag area ....  so when we call $(this).children it returns only the
> > > Span and if we do $(this).children(":not(span)") it returns NULL ...
> > > so Equally..... what should we do
>
> > > On Sep 30, 5:34 pm, equallyunequal <equallyuneq...@gmail.com> wrote:
>
> > > > Ok, how about something to the effect of:
>
> > > > $("p").each(function() { $
> > > > (this).children(":not(span)").css({color:"red"}); });
>
> > > > On Sep 30, 8:12 am, pedram...@gmail.com wrote:
>
> > > > > If I do this with CLone then all my prossesing is with the clone but I
> > > > > need to have a selector in the Original one not in the Clone so
> > > > > changing and modifying the clone is not necessary ,the only way is get
> > > > > a Clone of THe Span Then Remove the Span and then get the content of
> > > > > the P do some changes on it , after that add the Span again And I
> > > > > think this is not the right way to Deal with this ...
> > > > > I'm still working on thiws and waiting for the best way to it
> > > > > Thanks Pedram
>
> > > > > On Sep 30, 7:36 am, equallyunequal <equallyuneq...@gmail.com> wrote:
>
> > > > > > $("p:not(span)") would select all paragraphs that are not spans...
> > > > > > which would be all paragraphs even if they have a child that is a
> > > > > > span.
> > > > > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs
> > > > > > without child spans... which would be none of the paragraphs.
>
> > > > > > He needs the contents of all paragraphs minus the content of a span.
> > > > > > The only way (I can think of) to non-destructively get the contents of
> > > > > > an element minus some of its children is to clone it first, then
> > > > > > remove the children.
>
> > > > > > On Sep 29, 3:33 pm, dasacc22 <dasac...@gmail.com> wrote:
>
> > > > > > > um cant you just do something like $("p:not(span)") ??
>
> > > > > > > On Sep 28, 3:48 pm, equallyunequal <equallyuneq...@gmail.com> wrote:
>
> > > > > > > > This should work:
>
> > > > > > > > var clone = $("p").clone();
> > > > > > > > clone.find("span").remove();
>
> > > > > > > > clone.each( function() { console.log(this) } );
>
> > > > > > > > On Sep 28, 2:13 pm, pedram...@gmail.com wrote:
>
> > > > > > > > > Hi Guys,
>
> > > > > > > > > this is the Code which I am working on
>
> > > > > > > > > <p>
> > > > > > > > >   Data which I need to select and it hasn't  an attribute
> > > > > > > > >   <span> Data in a Span </span>
> > > > > > > > > </p>
> > > > > > > > > <p>
> > > > > > > > >   Data which I need to select and it hasn't  an attribute
> > > > > > > > >   <span> Data in a Span </span>
> > > > > > > > > </p>
> > > > > > > > > <p>
> > > > > > > > >   Data which I need to select and it hasn't  an attribute
> > > > > > > > >   <span> Data in a Span </span>
> > > > > > > > > </p>
> > > > > > > > > How could FIlter and Select the text Before the <span>
> > > > > > > > > does someone has an Idea ?

[jQuery] Re: Set height of element depending on only on its own position and window height?

Glad you solved it. I actually had a mistake in my last line, but
here's a working version:

http://www.monkeypuzzle.net/testfiles/jquery/divSize.htm

I added a window resize function so it always adapts to the window. As
you can see, nothing is absolutely positioned, and I threw a mixture
of elements above the div I wanted to size, just to confirm that it
really doesn't care what's there - it's measuring the offset from the
top of the window.

On Sep 30, 3:26 am, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
> Well, I managed to solve it.
>
> Using option relativeTo for the offset and setting the relativeTo to
> use my header div that is always present, and always absolutely
> positioned at top:0;
>
> Now I have a div that takes up whatever space is left down to bottom
> of viewport, just like I wanted. Thanks for all help!
>
> On 30 Sep, 10:18, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
>
> > Well, thanks, but it turns out that it does exactly the same as my own
> > function.
> > If I have a div above it with a SET TOP position, e.g. css: top:0; -
> > or whatever - it works.
> > But if I don't have nothing but a bunch of <br/> tags above the div,
> > or if I set the div above to psition:relative and remove the set top
> > position, it doesn't work anymore.
> > I really need some way to get the top offset for my div from the top
> > edge of the window, no matter what may or may not be above the div in
> > the DOM tree, and so far no luck.
> > But thanks for the effort, I appreciate it.
>
> > /Torgil
>
> > On 29 Sep, 21:26, rolfsf <rol...@gmail.com> wrote:
>
> > > try this:
>
> > > var wh = $(window).height();                            // window height
> > > var mt = $('#myDiv').offset().top;                              // top position of #myDiv
>
> > > $(mt).css('height', wh - mt - 20 + 'px');                       // set height of #myDiv
>
> > > On Sep 29, 8:33 am, Kabelkultur Gotland <tor...@kabelkultur.se> wrote:
>
> > > > Well, the $(window).height() gets the height for me.
>
> > > > What I need is something to measure the distance from the window top
> > > > and down to the element top.
> > > > And then subtract it from the window height, minus another 20 pix ad
> > > > use that value as height for the div.
>
> > > > If the window is 1000 px high, and the div starts 300px down, I'd like
> > > > to get 100 - 300 - 20 = 680
> > > > And then apply this as height for the div.
>
> > > > And this needs to be done without mixing in other elements that might
> > > > or might not be part of the dom tree between the window top and the
> > > > elements top position.
>
> > > > So I guess that the problem lies within the second measuring parameter
> > > > of my function:
> > > >    $ (".tableHolder").offset().top - this for some reason uses other
> > > > positioned elements for its calculation, and I need it not to.
>
> > > > Regards, Torgil - kabelkultur.se- Dölj citerad text -
>
> > > - Visa citerad text -- Dölj citerad text -
>
> > - Visa citerad text -

[jQuery] Tablesorter pager refresh pager

I am trying to update the tablesorter pager whenever I dynamically add or
delete a row from the table. So far I'm using tips from this post,
http://www.nabble.com/Add-row-and-refresh-tablesorter-with-pager.-td13236775s27240.html#a13236775

I am able to update the table and re-sort when a new row is added, but
whenever I delete a row, it sorts, but it fails to show the correct # of
rows. For example, if I have 16 rows, with a pager showing 15 per page, and
I delete a row dynamically, then my page will show 14 rows on page 1, and 1
row on page 2.
I'm caling this after add/delete:
$("#myTable").trigger("update");
$("#myTable").trigger("appendCache");
$("#myTable.tablesorter").get(0).config.sortList;
$("#myTable").trigger("sorton", [config.sortList]);
which updates the tablesorter, and works perfectly with the pager on add. If
I include the calls to the pager, before and after update like the post
above says, adding will also fail.

--
View this message in context: http://www.nabble.com/Tablesorter-pager-refresh-pager-tp19748007s27240p19748007.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

[jQuery] Re: Getting the id of the next form

Try this:
full jQuery
$("a.ctrl_s").bind("click",function() {saveForm( $
(this).next().attr("id") );});

would get the element after the "A" => "FORM" then get its id

On 30 Sep., 11:02, Bruce MacKay <b.mac...@massey.ac.nz> wrote:
> Hello folks,
>
> I have a page containing a number of forms e.g.
>
> <div id="alerts">
>          <p><a href="#" class="ctrl_s">[an image]</a></p>
>          <form id="f_alert">
>                  [various form elements]
>          </form>
> </div>
>
> <div id="whodidit">
>          <p><a href="#" class="ctrl_s">[an image]</a></p>
>          <form id="f_whodidit">
>                  [various form elements]
>          </form>
> </div>
>
> The class "ctrl_s" is bound to a function that will serialize the
> contents of the form and send the contents (via ajax) to the server
> for processing
>
> $("a.ctrl_s").bind("click",function() {saveForm( [the id of the next
> form] );});
>
> How do I get the "id of the next form" for sending to the "saveForm"
> function?   I'm afraid that I just don't yet understand selectors and
> traversing well enough to nut this out myself.
>
> Thanks,
>
> Bruce

[jQuery] Re: Insert content in row

Try this:
$('.rowContent').click(function(){
var row = this;
$.get("getCountryContent.cfm", { u: row.id }, function(data){
// this == the options for this ajax request
var $conteudo = trim12( data );
alert("Data Loaded: " + $conteudo);
$( '#' + row.id ).append( $conteudo );
});
});

http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype

On 30 Sep., 20:27, "Web Specialist" <especialista...@gmail.com> wrote:
> Hi all. I have this very simple content:
>
> <tr>
>     <td class="rowContent" id="902_1200_2008">United States</td>
> </tr>
> <tr>
>     <td class="rowContent" id="104_500_2008">Canada</td>
> </tr>
>
> When user clicks in any row i'll want to display the details about that row.
> I'm using this but without success:
>
> $('.rowContent').click(function(){
> $.get("getCountryContent.cfm", { u: this.id },
>   function(data){
>   var $conteudo = trim12( data );
>     alert("Data Loaded: " + trim12( data ));
>     $( '#' + this.id ).html(trim12( data )).append();
>   });
>
> });
>
> This ajax response is an html table...
>
> What's wrong?
>
> Cheers
> Marco Antonio

[jQuery] Re: Intercept "Back" button click on browser

Leanan wrote on 9/30/2008 10:10 AM:
> How can I make it so that when the user clicks the back button in
> their browser, this same thing happens, as I'll likely have people
> trying to click the back button instead of the back link on the "page"
> and then tell me it's broken. Is it even possible?

You'll want to use one of the history plug-ins:

http://plugins.jquery.com/project/history
http://plugins.jquery.com/project/jHistory

And the jQuery UI project has a history feature, although it sounds like it needs some work:

http://docs.jquery.com/UI/Tabs#Does_UI_Tabs_support_back_button_and_bookmarking_of_tabs.3F


- Bil

[jQuery] Insert content in row

Hi all. I have this very simple content:

<tr>
    <td class="rowContent" id="902_1200_2008">United States</td>
</tr>
<tr>
    <td class="rowContent" id="104_500_2008">Canada</td>
</tr>

When user clicks in any row i'll want to display the details about that row. I'm using this but without success:

$('.rowContent').click(function(){
$.get("getCountryContent.cfm", { u: this.id },
  function(data){
  var $conteudo = trim12( data );
    alert("Data Loaded: " + trim12( data ));
    $( '#' + this.id ).html(trim12( data )).append();
  });
});

This ajax response is an html table...

What's wrong?

Cheers
Marco Antonio



[jQuery] Re: select data in a

ignoring the

Wow amazing... it worked let me ask you question I think I can do it
with jQuery ..
do you know what does node.nodeType mean in javascript
nodeType=1 what does that mean for each value ?
thanks Pedram

On Sep 30, 8:29 pm, equallyunequal <equallyuneq...@gmail.com> wrote:
> I'm not sure how to do it in a "jQuery" way. But here's what I came up
> with:
>
> $( function(){
>         $("p").each( function() {
>                 var allButSpan = this.allButSpan = new Array();
>                 $.each(this.childNodes, function(i, node) {
>                         if (node.nodeName.toLowerCase() != "span")
> { allButSpan[allButSpan.length] = node; }
>                 });
>         });
>
>         $("p").each( function(){
>                 var innerHtml = "";
>                 $.each(this.allButSpan, function(i, node) { innerHtml +=
> (node.nodeType == 3) ? node.data : $(node).html(); } );
>                 console.log(innerHtml);
>         });
>
> });
>
> Example here:http://joeflateau.net/playground/testingpexcspan.html
>
> You need Firebug (or anything that supports console.log) to use the
> example!
>
> On Sep 30, 12:20 pm, Pedram <pedram...@gmail.com> wrote:
>
> > It didn't work Cause the Text isn't concern as a Children and it is in
> > No Tag area ....  so when we call $(this).children it returns only the
> > Span and if we do $(this).children(":not(span)") it returns NULL ...
> > so Equally..... what should we do
>
> > On Sep 30, 5:34 pm, equallyunequal <equallyuneq...@gmail.com> wrote:
>
> > > Ok, how about something to the effect of:
>
> > > $("p").each(function() { $
> > > (this).children(":not(span)").css({color:"red"}); });
>
> > > On Sep 30, 8:12 am, pedram...@gmail.com wrote:
>
> > > > If I do this with CLone then all my prossesing is with the clone but I
> > > > need to have a selector in the Original one not in the Clone so
> > > > changing and modifying the clone is not necessary ,the only way is get
> > > > a Clone of THe Span Then Remove the Span and then get the content of
> > > > the P do some changes on it , after that add the Span again And I
> > > > think this is not the right way to Deal with this ...
> > > > I'm still working on thiws and waiting for the best way to it
> > > > Thanks Pedram
>
> > > > On Sep 30, 7:36 am, equallyunequal <equallyuneq...@gmail.com> wrote:
>
> > > > > $("p:not(span)") would select all paragraphs that are not spans...
> > > > > which would be all paragraphs even if they have a child that is a
> > > > > span.
> > > > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs
> > > > > without child spans... which would be none of the paragraphs.
>
> > > > > He needs the contents of all paragraphs minus the content of a span.
> > > > > The only way (I can think of) to non-destructively get the contents of
> > > > > an element minus some of its children is to clone it first, then
> > > > > remove the children.
>
> > > > > On Sep 29, 3:33 pm, dasacc22 <dasac...@gmail.com> wrote:
>
> > > > > > um cant you just do something like $("p:not(span)") ??
>
> > > > > > On Sep 28, 3:48 pm, equallyunequal <equallyuneq...@gmail.com> wrote:
>
> > > > > > > This should work:
>
> > > > > > > var clone = $("p").clone();
> > > > > > > clone.find("span").remove();
>
> > > > > > > clone.each( function() { console.log(this) } );
>
> > > > > > > On Sep 28, 2:13 pm, pedram...@gmail.com wrote:
>
> > > > > > > > Hi Guys,
>
> > > > > > > > this is the Code which I am working on
>
> > > > > > > > <p>
> > > > > > > >   Data which I need to select and it hasn't  an attribute
> > > > > > > >   <span> Data in a Span </span>
> > > > > > > > </p>
> > > > > > > > <p>
> > > > > > > >   Data which I need to select and it hasn't  an attribute
> > > > > > > >   <span> Data in a Span </span>
> > > > > > > > </p>
> > > > > > > > <p>
> > > > > > > >   Data which I need to select and it hasn't  an attribute
> > > > > > > >   <span> Data in a Span </span>
> > > > > > > > </p>
> > > > > > > > How could FIlter and Select the text Before the <span>
> > > > > > > > does someone has an Idea ?

24 new messages in 13 topics - digest

comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=en

comp.lang.c++@googlegroups.com

Today's topics:

* cout vs std::cout - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/4f48acdaa9e16cee?hl=en
* unscrambling typeid().name - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/a1dcc8d6a662d966?hl=en
* Using BFD - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/d889b8651eb84cfd?hl=en
* wrapping std::vector<> to track memory usage? - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/03c4b2188e8040c6?hl=en
* Global object initialization - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/4eccf55d938f3bf2?hl=en
* Trying to apply SFINAE - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/2d8ff4d0d6e8c793?hl=en
* How to make non-blocking call to cin? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/0ab112b61c8dc29e?hl=en
* What's the standard say about this code? - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/ba343bcb425e7e31?hl=en
* passing object reference to the method - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/ce783dea61c7f4b8?hl=en
* how to use libstdc++.so.5 instead of libstdc++.so.6 - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/b79b9c199d58416b?hl=en
* C++ gurus, keywords: programming,search, expertise - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/c7f14464d8307503?hl=en
* ODR: A simple question - 2 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/d65f12d76742875b?hl=en
* (&vec)== &vec[0]? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/d77c87f0acfdcd75?hl=en

==============================================================================
TOPIC: cout vs std::cout
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/4f48acdaa9e16cee?hl=en
==============================================================================

== 1 of 3 ==
Date: Tues, Sep 30 2008 6:18 am
From: ytrembla@nyx.nyx.net (Yannick Tremblay)


In article <gbqvc0$2um$2@cb.generation-online.de>,
Hendrik Schober <spamtrap@gmx.de> wrote:
>Yannick Tremblay wrote:
>> In article <gbqqk9$v30$1@cb.generation-online.de>,
>> Hendrik Schober <spamtrap@gmx.de> wrote:
>>> Yannick Tremblay wrote:
>>>> [Ridiculous example deleted]
>>> No. The next project introduced its string utilities
>>> in a namespace 'Strings'.
>>
>> But the point remains that "Strings" is less clear than "StringUtility".
>>
>> In this particular case, the loss of clarity is probably acceptable
>> but that virtual ban on namespaces is IMO a bad thing because I
>> think it encourages bad naming.
>
> Which ban?

I did write *virtual* ban but sorry, I mean virtual ban of "using
namespace" not on "namespace" themselves.

The exact quote was:
"Most of the time I worked under the rule that using declarations (and
even using directives!) where allowed within any local scopes not
bigger than a function,"

IMO, this amount to a virtual ban. given that function scopes should
hopefully average less than 20 line and that in these 10-20 lines, you
are unlikely to use things from a particular namespace more than 3-5
times, then typing "using namespace String;" takes about as much
typing effort as 3 explicit String::. May almost as well ban them.
Obviously, then might become somewhat useful in 200 liners functions
but of course these should already have been banned well before the
restrictions on "using" was written :-)

Yannick

== 2 of 3 ==
Date: Tues, Sep 30 2008 6:55 am
From: LR


James Kanze wrote:
> On Sep 29, 5:35 am, Rolf Magnus <ramag...@t-online.de> wrote:
>
> [...]
>> A disadvantage of explicitly qualifying with ::std or even
>> with std is that it makes it hard to create your own cout and
>> replace all uses of the standard cout with this one.
>
> I'd say just the opposite. A global search and replace on
> \<std::cout\> will work just fine. A global search and replace
> on \<cout\> will change not only the cout in std, but any other
> cout you happen to have as well. (And of course, if it's
> something special, you probably want to call it something other
> than cout anyway.)
>
>> If you have a
>
>> using std::cout;
>
>> cout << "Hello world\n";
>
>> you can simply replace the using declaration and you're done
>> instead of changing every single occurance of cout in your
>> code.
>
> The problem with this is that it fools the reader. If you see
> cout, and you know that the programmer often makes use of using
> declarations, you'll just assume that it's std::cout. If you
> see std::cout, you know it's std::cout, and if you see
> MyNamespace::cout, you know it isn't.

Sometimes, because of the environment I use I find this little snippet
useful:

namespace non_std { // or whatever namespace you'd like
std::ostream &cout = std::cout;
}

And in other code...
non_std::cout << "something" << std::endl;

When I don't want to write to std::cout for some reason, it's pretty
easy to change non_std::cout to refer to some other stream.

I do have to pay attention to what non_std::cout is.

LR

== 3 of 3 ==
Date: Tues, Sep 30 2008 9:19 am
From: Juha Nieminen


James Kanze wrote:
> I can't think of any really good examples involving
> IO, but to take Juha's example, if you have a 10 line function
> that invokes std::replace in 5 different places, I'd see nothing
> objectionable to a:
> using std::replace ;
> at the top of the function.

So you write 19 characters (plus indentation plus a newline) to save
25 characters, for a total net saving of 6 characters (and only if we
don't count the indentation whitespaces and newline).

I really don't see the point.


==============================================================================
TOPIC: unscrambling typeid().name
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/a1dcc8d6a662d966?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Sep 30 2008 6:22 am
From: Marco Manfredini


Deepak Jharodia wrote:

> I'm using a templatized class in GCC based environ
>
> template<class A, class B>
> class foo {...
> ...} F;
>
> Now I want to know that particular instance of this class was
> instantiated with what template arguments. typeid.name() returns a
> strange string with all the info but abbreviated and probably platform
> specific.
> How can I unscramble it and probably use it my program during runtime?
>

For recent versions of GCC, __cxa_demangle unscrambles the typename.
Please see the manual:
http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch39.html


==============================================================================
TOPIC: Using BFD
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/d889b8651eb84cfd?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Sep 30 2008 6:55 am
From: Victor Bazarov


Deepak Jharodia wrote:
> On Sep 26, 5:57 pm, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
>> Deepak Jharodia wrote:
>>> I've done some study about BFD(binary file descriptor) library and
>>> have following doubts:
>>> If I inlcude libbfd.a in my final executable can I use this executable
>>> to read it'sown symbol table, by reading libbfd.a? Is it possible? Is
>>> there any other(/better) way to do this?
>> What is your C++ *language* question, again?
>
> Can you please guide me to correct group for this?

I am not sure what the "binary file descriptor" is, but from the word
"file" I can imagine that the first newsgroup you should try is the one
that deals with your OS. Since you didn't say what your OS is, I'll
make a guess that ti's Linux, so try 'comp.os.linux.development.apps'.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


==============================================================================
TOPIC: wrapping std::vector<> to track memory usage?
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/03c4b2188e8040c6?hl=en
==============================================================================

== 1 of 3 ==
Date: Tues, Sep 30 2008 7:00 am
From: jacek.dziedzic@gmail.com

Hi!

I need to be able to track memory usage in a medium-sized
application I'm developing. The only significant (memory-wise) non-
local objects are of two types -- std::vector<> and of a custom class
simple_vector<> that is a hand-rolled substitute for array<>. With the
latter I have code that tracks all allocations and destructions, so I
can account for all the memory.

The question is about std::vector<> -- how can I track memory usage
by individual std::vector's? I'm thinking along the lines of a wrapper
(templated) class, like std::tracked_vector<> which would have the
original std::vector<> as a private member, delegate relevant
operations to the underlying std::vector, while doing the accounting
job behind the scenes.

Are there any particular pitfalls to such a design? Would it suffice
to delegate only the methods I actually use,
like .size(), .reserve(), .at(), [] operators, etc. or would I need to
delegate all possible methods? I fear that since I use the
std::vector's in stl algorithms and other stl containers (vectors of
vectors), I might need to delegate all the iterator stuff and other
methods I don't use directly, is this the case? How do I account for
vectors of vectors, so that I don't bill the same memory twice?

Surely, someone must have gone that route, are there any particular
do's and don'ts there? Is it feasible? I don't want to reinvent the
wheel.

TIA,
- J.

== 2 of 3 ==
Date: Tues, Sep 30 2008 8:29 am
From: Maxim Yegorushkin


On Sep 30, 3:00 pm, jacek.dzied...@gmail.com wrote:

>   I need to be able to track memory usage in a medium-sized
> application I'm developing. The only significant (memory-wise) non-
> local objects are of two types -- std::vector<> and of a custom class
> simple_vector<> that is a hand-rolled substitute for array<>. With the
> latter I have code that tracks all allocations and destructions, so I
> can account for all the memory.
>
>   The question is about std::vector<> -- how can I track memory usage
> by individual std::vector's? I'm thinking along the lines of a wrapper
> (templated) class, like std::tracked_vector<> which would have the
> original std::vector<> as a private member, delegate relevant
> operations to the underlying std::vector, while doing the accounting
> job behind the scenes.

[]

You could use a custom allocator that would maintain a counter of how
much memory has been allocated. Something like that:

#include <vector>
#include <iostream>

size_t allocated;

void print_allocated(int n)
{
std::cout << n << ": " << allocated << '\n';
}

template<class T>
struct counted_allocator : std::allocator<T>
{
template<class U>
struct rebind { typedef counted_allocator<U> other; };

typedef std::allocator<T> base;

typedef typename base::pointer pointer;
typedef typename base::size_type size_type;

pointer allocate(size_type n)
{
allocated += n * sizeof(T);
return this->base::allocate(n);
}

pointer allocate(size_type n, void const* hint)
{
allocated += n * sizeof(T);
return this->base::allocate(n, hint);
}

void deallocate(pointer p, size_type n)
{
allocated -= n * sizeof(T);
this->base::deallocate(p, n);
}
};

int main()
{
typedef std::vector<int, counted_allocator<int> > IntVec;

print_allocated(0);
{
IntVec v;
v.resize(1000);
print_allocated(1);
v.resize(2000);
print_allocated(2);
IntVec u = v;
print_allocated(3);
}
print_allocated(4);
}


Output:
0: 0
1: 4000
2: 8000
3: 16000
4: 0

--
Max

== 3 of 3 ==
Date: Tues, Sep 30 2008 9:51 am
From: Juha Nieminen


jacek.dziedzic@gmail.com wrote:
> Would it suffice to delegate only the methods I actually use,
> like .size(), .reserve(), .at(), [] operators, etc. or would I need to
> delegate all possible methods?

std::vector itself obviously doesn't require anything about your
delegating functions. You can implement those functions which you need
and leave the rest. (Of course you will find that you will have to keep
adding delegating functions as you start using vector functions in your
code which you weren't using before. But as long as you have access to
the wrapper class, it shouldn't be a huge problem.)

Note, however, that by using this technique you will only be able to
track the amount of space requested from std::vector *explicitly*.
There's no way of knowing how much memory the std::vector is *really*
allocating behind the scenes. Also, even if you were able to do that, it
wouldn't help you knowing the real amount of RAM used. All allocations
have a certain overhead to them, and especially std::vector easily
causes memory fragmentation when it grows, and you might end up having a
significant amount of unused memory which is nevertheless allocated from
the system because of memory fragmentation. In the worst case scenario
the real memory usage of your program (ie. what your program requests
the OS to allocate for it) might be even over double the amount of
memory that you are *explicitly* allocating (and tracking).

Explicit memory allocation tracking is a lot less useful than one
might think, at least if what you are trying to do is to estimate how
much RAM your program is consuming. You will only get a very rough lower
limit, while the actual memory usage may be much larger (even
significantly larger in the worst cases).


==============================================================================
TOPIC: Global object initialization
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/4eccf55d938f3bf2?hl=en
==============================================================================

== 1 of 3 ==
Date: Tues, Sep 30 2008 7:27 am
From: Pete Becker


On 2008-09-30 09:02:29 -0400, Zeppe
<zep_p@remove.all.this.long.comment.yahoo.it> said:

> Pete Becker wrote:
>
>> In this example, that's true. But there's nothing special about main.
>
> There is, indeed.

Well, yes, main is in some ways special. But we were talking about
initialization, and the rule, once again, is that static objects must
be initialized before the first entry into any function defined in the
same translation unit. It doesn't matter whether the name of that
function is main, foo, bar, or billy. And it doesn't matter whether
main is also in that translation unit.

> And in particular, since main cannot be called explicitly, you are
> sure that the static variable is initialised before.

Again: that's true for every function, regardless of whether it can be
called explicitly.

> In addition, I'd say all the static variables from all the translation
> units are initialised before main() is called.

That's not required by the standard. The rule is as I've set out above.
That's a provision for dynamically linked libraries, which can be
loaded on demand, and don't initialize their statics until they are
loaded.

> What is undefined is the order of initialisation of static variables
> from different translation units.

That is unspecified, not undefined. But it's subject to the rule about
initizaliation before use of a function, as above.

> So, if g_a is used in a function foo that is called during the
> initialisation of a global variable in another translation unit, there
> can be problems.

Indeed.

>
> Usually in this cases a function returining a reference to the static
> variable can force a safe order of initialisation (even though by
> itself doesn't guarantee the initialisation before main).
>
> A g_a()
> {
> static A g_a;
> return g_a;
> }
>

That's one way to manage initialization order, but that's a separate
issue from the requirement about initialization before entry into a
function.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

== 2 of 3 ==
Date: Tues, Sep 30 2008 8:37 am
From: Maxim Yegorushkin


On Sep 30, 11:44 am, Pete Becker <p...@versatilecoding.com> wrote:
> On 2008-09-30 04:07:55 -0400, asm23 <asmwarr...@gmail.com> said:
>
>
>
> > kirya...@gmail.com wrote:
> >> Hello. Given the code below does C++ Standard guarantee that the
> >> function my_init() will be called before main()?
>
> >> struct A
> >> {
> >>     A()
> >>     {
> >>        my_init();
> >>     }
> >> };
>
> >> A g_a;
>
> >> int main()
> >> {
> >>     // ...
> >> }
> > Yes, a global variable will be initialized *before* main() entered. So,
> > the constructor of A will call my_init() before main().
>
> In this example, that's true. But there's nothing special about main.
> Global variables will be initialized before entry into any function
> defined in the same translation unit as the variable.

Please note, that there is nothing preventing a function to be called
before the global variables from the same translation unit are
initialised. For example, from a constructor of a global object from
another TU which happens to be initialised before the TU where the
function resides.

--
Max

== 3 of 3 ==
Date: Tues, Sep 30 2008 8:53 am
From: Pete Becker


On 2008-09-30 11:37:05 -0400, Maxim Yegorushkin
<maxim.yegorushkin@gmail.com> said:

>
> Please note, that there is nothing preventing a function to be called
> before the global variables from the same translation unit are
> initialised.

Now that I've looked it up, I see that I've overstated the rule. The
actual rule is that It's implementation-defined whether the
implementation does dynamic initialization before entry into main. If
it defers initialization, it must do dynamic initialization of objects
defined in a translation unit before the first use of any function or
object defined in the same translation unit. So in the typical case
where all the translation units are linked together and their statics
are initialized before entry into main, there is no requirement on the
relative order of dynamic initialization of objects defined in
different translation units.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)


==============================================================================
TOPIC: Trying to apply SFINAE
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/2d8ff4d0d6e8c793?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Sep 30 2008 7:50 am
From: Victor Bazarov


Hendrik Schober wrote:
> Victor Bazarov wrote:
>> Hendrik Schober wrote:
>> [...]
>>
>> Well, the compiler cannot deduce the type from a default argument, I
>> vaguely recall that it's a non-deducible context. That's why putting
>> the traits there won't cut it. Consider
>>
>> #include <iterator>
>>
>> template<typename Iter>
>> void test(Iter, Iter, std::iterator_traits<Iter> const* = 0);
>>
>> int main ()
>> {
>> const int fa[] = { 1,2,3,4 };
>> test(fa, fa+4);
>> }
>
> Thanks! However, while the above works, this doesn't:
>
> #include <iterator>
>
> template< typename T >
> void test( T /*a1*/, T /*a2*/ ) {}
>
> template< typename Iter >
> void test( Iter /*b*/, Iter /*e*/
> , std::iterator_traits<Iter> = std::iterator_traits<Iter>()
> ) {}
>
> int main()
> {
> const int fa[] = { 255, 255, 255, 255 };
>
> test(0,1);
> test(fa, fa+4);
>
> return 0;
> }
>
> (Both VC and Comeau complain it's ambiguous.) But that's
> just what I need.

They are probably correct :-/

Let's try to involve a class where you can make a partial specialisation:

template<class T, bool> struct ActualWorker; // "abstract"
template<class T> struct ActualWorker<T,false> // non-iterator
{
static void test(T /*a1*/, T /*a2*/) { /*whatever*/ }
};

template<class T> class ActualWorker<T,true> // iterator
{
static void test(T /*i1*/, T /*i2*/) { /*whatever*/ }
};

// now - how do we determine it's an iterator?
template<class T> struct IsIterator { enum { yes = 0 }; };
template<class T> struct IsIterator {
... // here you need to add some way to set 'yes' to 1
... // if 'T' is an iterator. It's up to you to define
... // what is an iterator and what isn't.
};

template<class T> void test(T t1, T t2) {
return ActualWorker<T, IsIterator<T>::yes >::test(t1, t2);
}

int main()
{
test(42, 666);
int foo[] = { 1,2,3,4 };
test(foo, foo+4);
}

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


==============================================================================
TOPIC: How to make non-blocking call to cin?
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/0ab112b61c8dc29e?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Sep 30 2008 8:36 am
From: ytrembla@nyx.nyx.net (Yannick Tremblay)


In article <gbssvu$dp7$2@south.jnrs.ja.net>, Lionel B <me@privacy.net> wrote:
>On Mon, 29 Sep 2008 15:18:56 +0000, Yannick Tremblay wrote:
>
>> In article
>> <f1ea726e-49a0-440b-bad9-1c8ca1637b11@a70g2000hsh.googlegroups.com>,
>> puzzlecracker <ironsel2000@gmail.com> wrote:
>>>is it even possible or/and there is a better alternative to accept input
>>>in a nonblocking manner?
>>
>> I'd avoid the problem altogether:
>>
>> I'd simply create a cin reader thread whose job would be to read input
>> safely from a blocking cin. It could also be charged with validating
>> this input if desirable.
>>
>> I'd put a thread safe FIFO communication mechanism between the two
>> threads (e.g. mutex protected std::queue) and the main process thread
>> would peek if there is a message on the queue for it, if so, read and
>> process it, if not, continue with its other tasks.
>>
>> To me, that sounds simpler than trying to turn cin as non-blocking. plus
>> anyway, non-blocking cin would think that there is data to be read if
>> only one character was present in the buffer but you may wish to get
>> input as complete words (lines?) and not interrupt normal processing
>> until a complete word is available. This would be trivial to do with
>> the input thread model but much more difficult with a non-blocking cin
>> or stdin.
>
>That sounds pretty complicated to me... but then I really don't know how
>you'd make cin non-blocking (or non-line-buffered, for that matter), so I
>don't know how complicated that would be.

Depends. I am fairly confortable with threads. Using boost threads,
creating a thread in a sane way is a couple of lines, a thread-safe
queue is obviously something that I have sitting in that library ready
to be used, so really not as complicated as it may sound.

It also make a nice separation of task:
Main thread does the processing
User input thread manage user input, read it and validate it before
passing it to the main thread.

Both threads have very limited interaction which is a good idea with
threads.
Each threads is individually simpler than if it was trying to do both
task in one.
Each thread can be independently tested.
Pattern very easy to extend to input via other channels than cin.

>But if you're prepared to forgo cin and use stdin, then (at least in
>unix) it's pretty straightforward - including getting line-buffered
>input in non-blocking mode. See e.g. my simple stdin control utilities
>and demo:
>
>ftp://ftp.informatics.sussex.ac.uk/pub/users/lionelb/misc/stdin_control

I had a peek at it. It's a nice little wrapper over fcntl. It would
probably be the better choice for simple task like non-blocking
character input.

Yannick


==============================================================================
TOPIC: What's the standard say about this code?
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/ba343bcb425e7e31?hl=en
==============================================================================

== 1 of 3 ==
Date: Tues, Sep 30 2008 8:40 am
From: "Daniel T."


#include <cassert>

class Foo {
public:
virtual void fnA() = 0;
virtual void fnB() = 0;
};

int main() {
assert( &Foo::fnB );
assert( &Foo::fnA );
}

What does the standard say about the above code? In the compiler I'm
using now, the first assert will not fire, but the second one will. I
expected that neither assert would fire...

== 2 of 3 ==
Date: Tues, Sep 30 2008 8:53 am
From: Maxim Yegorushkin


On Sep 30, 4:40 pm, "Daniel T." <danie...@earthlink.net> wrote:
> #include <cassert>
>
> class Foo {
> public:
>         virtual void fnA() = 0;
>         virtual void fnB() = 0;
>
> };
>
> int main() {
>         assert( &Foo::fnB );
>         assert( &Foo::fnA );
>
> }
>
> What does the standard say about the above code? In the compiler I'm
> using now, the first assert will not fire, but the second one will. I
> expected that neither assert would fire...

Are you sure that the second assert is failing?

Both &Foo::fnB and &Foo::fnA should yield a non-NULL member function
pointer, which gets converted to bool(true) when passed into assert().

--
Max

== 3 of 3 ==
Date: Tues, Sep 30 2008 9:21 am
From: "Daniel T."


On Sep 30, 11:53 am, Maxim Yegorushkin <maxim.yegorush...@gmail.com>
wrote:
> On Sep 30, 4:40 pm, "Daniel T." <danie...@earthlink.net> wrote:
>
>
>
> > #include <cassert>
>
> > class Foo {
> > public:
> >         virtual void fnA() = 0;
> >         virtual void fnB() = 0;
>
> > };
>
> > int main() {
> >         assert( &Foo::fnB );
> >         assert( &Foo::fnA );
>
> > }
>
> > What does the standard say about the above code? In the compiler I'm
> > using now, the first assert will not fire, but the second one will. I
> > expected that neither assert would fire...
>
> Are you sure that the second assert is failing?
>
> Both &Foo::fnB and &Foo::fnA should yield a non-NULL member function
> pointer, which gets converted to bool(true) when passed into assert().

Yes, I am sure that the second assert is failing. If this is a
compiler bug, then I will submit it to the vendor, but I want to make
sure it actually *is* a compiler bug first.


==============================================================================
TOPIC: passing object reference to the method
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/ce783dea61c7f4b8?hl=en
==============================================================================

== 1 of 3 ==
Date: Tues, Sep 30 2008 8:55 am
From: Pete Becker


On 2008-09-30 11:51:35 -0400, puzzlecracker <ironsel2000@gmail.com> said:

> Say I pass an object of a class (reference value I suppose) to a
> method, and I want to pass it by reference. Do I need to preappend
> it with ref.
>
> public interface IFoo{}
>
> public class Foo:IFoo{
>
> }
>
> void FromHere()
> {
>
> Foo f=new Foo();
> Here(ref f);
>
> }
>
> void Here(ref IFoo f )
> {
> //do something with f
> }
>
> Is ref redundant or error-prone. In my scenerio I have a lot of
> overload for Here-like function,
> and compiler screams that it cannot convert IFoo to char (latter
> beeing void Here(ref char c) )
>

This usage of ref is not part of standard C++. If a function takes an
argument by reference that argument is marked as a reference like this:

void Here(IFoo& f)

and it's called with the object:

Foo f;
Here(f);

Note that this is different from what the above code is doing, since
Foo f= new Foo() creates a pointer. I have no idea what the meaning of
those 'ref' decorations is.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

== 2 of 3 ==
Date: Tues, Sep 30 2008 8:58 am
From: Obnoxious User


On Tue, 30 Sep 2008 08:51:35 -0700, puzzlecracker wrote:

> Say I pass an object of a class (reference value I suppose) to a method,
> and I want to pass it by reference. Do I need to preappend it with
> ref.
>
> public interface IFoo{}
>
> public class Foo:IFoo{
>
> }
>
> void FromHere()
> {
>
> Foo f=new Foo();
> Here(ref f);
>
> }
>
> void Here(ref IFoo f )
> {
> //do something with f
> }
>
> Is ref redundant or error-prone. In my scenerio I have a lot of
> overload for Here-like function,
> and compiler screams that it cannot convert IFoo to char (latter
> beeing void Here(ref char c) )
>

Are your sure this is C++? Most likely CLI/C++ or some
other Microsoft managed version.

--
OU
Remember 18th of June 2008, Democracy died that afternoon.
http://frapedia.se/wiki/Information_in_English

== 3 of 3 ==
Date: Tues, Sep 30 2008 10:29 am
From: puzzlecracker


On Sep 30, 11:58 am, Obnoxious User <O...@127.0.0.1> wrote:
> On Tue, 30 Sep 2008 08:51:35 -0700, puzzlecracker wrote:
> > Say I pass an object of a class (reference value I suppose) to a method,
> > and  I want to pass it by reference. Do  I need to preappend it with
> > ref.
>
> > public interface IFoo{}
>
> > public class Foo:IFoo{
>
> > }
>
> > void FromHere()
> > {
>
> >      Foo f=new Foo();
> >      Here(ref f);
>
> > }
>
> > void Here(ref IFoo f )
> > {
> >      //do something with f
> > }
>
> > Is ref redundant or error-prone.  In my scenerio I have a lot of
> > overload for Here-like function,
> >  and compiler screams that it cannot convert IFoo to char (latter
> > beeing void Here(ref char c) )
>
> Are your sure this is C++? Most likely CLI/C++ or some
> other Microsoft managed version.
>
> --
> OU
> Remember 18th of June 2008, Democracy died that afternoon.http://frapedia.se/wiki/Information_in_English

Guys, It's csharp. I accidentally post this question here. It's now
reposted to the appropriate group.


==============================================================================
TOPIC: how to use libstdc++.so.5 instead of libstdc++.so.6
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/b79b9c199d58416b?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Sep 30 2008 8:59 am
From: ytrembla@nyx.nyx.net (Yannick Tremblay)


This is off topic for this newsgroup. There are GNu newsgroups and Linux
development newsgroup where this would be more appropriate.

However, what you are trying to do is not quite simple nor totally reliable.
As you can see by the output of ldd, you have moved from .5 to .6 for
libstcdc++but the other libraries are also of a different version.

As an alternative, you could instead make a virtual machine on your dev
machine that is similar to the build machine. It might save you a lot of
hassle.

In article <6a70cf83-46e0-4605-ae88-62e5ac34a9dc@k13g2000hse.googlegroups.com>,
Alexander Dong Back Kim <alexdbkim@gmail.com> wrote:
>Dear all members,
>
>First of all, I apologize I posted such a topic which is not purely
>related with this group. The reason why I posted this is I hope some
>of members this group knows about g++ and they have better idea about
>my problem so please forgive my post.
>
>I have this problem that development machine's default C++ library is
>libstdc++.so.6. of course the OS is linux. However, the target machine
>has libstdc++.so.5 so I copied the library file to dev machine.
>
>Therefore, the dev machine has both version 5 and 6 of libstdc++
>whereas the target machine has only version 5. I wrote and tested the
>following application (not really an application) on the target
>machine.
>
>#include <iostream>
>using namespace std;
>int main() { cout << "hello" << endl; return 0; }
>
>I compile the code with...
>
>target $ g++ main.cpp
>
>It, of course, produces "a.out". I did "ldd" to see what shared (or
>dynamic) library the application links and the result was...
>
> libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x00c25000)
> libm.so.6 => /lib/tls/libm.so.6 (0x00951000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x006af000)
> libc.so.6 => /lib/tls/libc.so.6 (0x0026c000)
> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00a42000)
>
>Now I compiled the same application on the dev machine and did the
>same command and the result is...
>
> libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x005e8000)
> libm.so.6 => /lib/tls/libm.so.6 (0x00372000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00555000)
> libc.so.6 => /lib/tls/libc.so.6 (0x0023e000)
> /lib/ld-linux.so.2 (0x00224000)
>
>If I run the application, which was compiled on the dev machine, on
>the target machine it says an error message...
>
>./a.out: error while loading shared libraries: libstdc++.so.6: cannot
>open shared object file: No such file or directory
>
>This totally makes sense because the target machine doesn't have the
>library "libstdc++.so.6". I did "ldd" and it shows more specific
>reason.
>
> libstdc++.so.6 => not found
> libm.so.6 => /lib/tls/libm.so.6 (0x0079b000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00689000)
> libc.so.6 => /lib/tls/libc.so.6 (0x00111000)
> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x0046c000)
>
>Now, I start falling in a panic because I have so many questions about
>next step. I simply thought I might be able to copy the lib file
>"libstdc++.so.6" from dev machine to target machine. However, I'm
>wornding whether this is right thing to do. Is this problem that
>simple? Would it cause some weird problems when a application needs to
>use such thing like RTTI or exception handling? Because of these many
>doubt, I slightly think about another way of doing this. What about
>using "libstdc++.so.5" when I compile the application on the dev
>machine?
>
>Now. How can I do this? I have no idea how I can force g++ choose
>libstdc++.so.5 instead of libstdc++.so.6? Moreover, I'm also worrying
>about whether it is right thing...
>
>or is whole my idea just crap? Please give me any suggestion or idea
>before I knock the door of hell...
>
>regards,
>Alex Kim



==============================================================================
TOPIC: C++ gurus, keywords: programming,search, expertise
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/c7f14464d8307503?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Sep 30 2008 10:13 am
From: sasha


On Sep 29, 9:24 pm, red floyd <no.spam.h...@example.com> wrote:
> Andrey Hristoliubov wrote:
>
> [mostly redacted]
>
> FAQ 5.11  (http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.11)
>
>
>
>   and Bjarne Stroustrup (he asked me> for help to design C++ ; still unsure why he didn't give me enought
> > credit - probably a poor design choice to have Russian name near c+
> > +)
>
> And if my aunt had balls, she'd be my uncle.

This guy sent me his resume, awhile back, also looking for a job.
It's rather comical -- look at his latest experience. Absurd!


==============================================================================
TOPIC: ODR: A simple question
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/d65f12d76742875b?hl=en
==============================================================================

== 1 of 2 ==
Date: Tues, Sep 30 2008 10:58 am
From: ebony.soft@gmail.com


On Sep 29, 2:17 pm, Pete Becker <p...@versatilecoding.com> wrote:
> On 2008-09-29 06:01:07 -0400, ebony.s...@gmail.com said:
>
>
>
> > I encountered a simple but IMO important problem about the C++ linkage
> > model and One Definition Rule. Why the following code link?
>
> > file1.cpp
> > int x;
>
> > file2.cpp
> > double x;
>
> > x was defined in two different translation units with different types.
> > It breaks the ODR.
>
> The language definition doesn't require compilers to diagnose
> violations of the ODR. Code like this has undefined behavior. As a
> practical matter, recognizing errors like this is expensive, given
> C++'s separate compilation model.
>
> --
>   Pete
> Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
> Standard C++ Library Extensions: a Tutorial and Reference
> (www.petebecker.com/tr1book)

Sorry for a day delay. I was out of office.
Thank you pete for you answer, but I didn't completely convince.
I thought may be some standard conversions were made (double to int or
vice versa)
I changed double to std::string, but program run. Just when I declare
the variable
with extern, I have to specifiy the type and compiler find the real
type.
Which clause or section of C++ standard draft mention your answer?

Regards,
- Saeed Amrollahi

== 2 of 2 ==
Date: Tues, Sep 30 2008 11:06 am
From: ebony.soft@gmail.com


On Sep 29, 4:44 pm, James Kanze <james.ka...@gmail.com> wrote:
> On Sep 29, 1:17 pm, Pete Becker <p...@versatilecoding.com> wrote:
>
> > On 2008-09-29 06:01:07 -0400, ebony.s...@gmail.com said:
> > > I encountered a simple but IMO important problem about the
> > > C++ linkage model and One Definition Rule. Why the following
> > > code link?
> > > file1.cpp
> > > int x;
> > > file2.cpp
> > > double x;
> > > x was defined in two different translation units with
> > > different types.  It breaks the ODR.
> > The language definition doesn't require compilers to diagnose
> > violations of the ODR. Code like this has undefined behavior. As a
> > practical matter, recognizing errors like this is expensive, given
> > C++'s separate compilation model.
>
> And the relatively low quality of most linkers.  It wouldn't be
> very hard to implement, if the linker supported it.  For
> historical reasons, most linkers don't.
>
> --
> James Kanze (GABI Software)             email:james.ka...@gmail.com
> Conseils en informatique orientée objet/
>                    Beratung in objektorientierter Datenverarbeitung
> 9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Sorry for a day delay. I was out of office.
Thank you for your answer. AFAIR, Stroustrup mentioned the poor
quality of linkers in 1st edition
of his book. Where can I find, C++ Linker specific information?

Regards,
Saeed Amrollahi


==============================================================================
TOPIC: (&vec)== &vec[0]?
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/d77c87f0acfdcd75?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Sep 30 2008 11:14 am
From: Ioannis Vranos


C++03:


Is it always guaranteed that in vector:


vector<int> vec(10);

&vec always points to the first element of the array, for vec.size()> 0?

==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c++"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c++?hl=en

To unsubscribe from this group, send email to comp.lang.c+++unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c++/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

[jQuery] Re: I want to reduce the header calls

found this... may-be this may help ???

<script type="text/javascript">
if (navigator.browserLanguage){language=navigator.browserLanguage}
if (navigator.userLanguage){language=navigator.userLanguage}
if (navigator.systemLanguage){language=navigator.systemLanguage}
if (navigator.language){language=navigator.language}
if (language.indexOf('-')==2) {language=language.substring(0,2);}
if (language=='en') { document.write("Hello there!"); }
else if (language=='jp') { document.write("Konichiwa!"); }
else if (language=='fr') { document.write("Bonjour!"); }
</script>

On Sep 30, 9:47 am, jeremyBass <dbjer...@cableone.net> wrote:
> So I think this is the ticket... but I really am not to sure on the
> how yet...
>
> http://code.google.com/p/urlrewritefilter/
>
> anyone have a sec to help me out with this? thank you
> jeremyBass
>
> On Sep 29, 7:37 pm, jeremyBass <dbjer...@cableone.net> wrote:
>
>
>
> > I new that was to good to be true... well moving on to a new view ....
> > There has to be a way to "capture" the HTTP requests ... I think I've
> > seen URL rewrites with javascript... so may-be I could have it so that
> > it's more like this... if HTPP request is in array die else execute
> > and push URL to array?  any ideas on that?
>
> > thanks for the help...
> > jeremyBass
>
> > On Sep 29, 4:13 pm, ricardobeat <ricardob...@gmail.com> wrote:
>
> > > Oops, sorry, what I meant is that cloning the elements is the best
> > > optimization you can do. It will save you some processing time from
> > > not creating new elements (or maybe not, as jQuery will be re-creating
> > > the clone element), but the HTTP requests will remain.
>
> > > $('#flash-round-corner-
> > > thing').clone().appendTo('newcorner').clone().appendTo('anothercorner')
> > > etc.
>
> > > On Sep 29, 1:08 am, jeremyBass <dbjer...@cableone.net> wrote:
>
> > > > Thank you for the help...
>
> > > > >>> And using dozens of flash objects to round corners doesn't seem like a
> > > > >>> good idea...
>
> > > > Yeah I thought there would be alot of trouble to at first... but it's
> > > > better then cornflex and jcorner altogether... it's absolutely working
> > > > perfectly.  the 10-12 calls are on the first download only and it's
> > > > not the round boxes... it's mostly the srif anyways... but that's
> > > > ok... I'm just being anal and trying to work out everything before I
> > > > share this with everyone.  right now the round box mod is total 1kb
> > > > big if you already have jflash.js.  And it's... well I'll share this
> > > > all in bit... I want to protect it and have never done that before...
> > > > like a gpl? or something... anyways...
>
> > > > >>> If the element is already being cloned instead of being created again,
> > > > >>>  there is no fix.
>
> > > > so if they aren't?  I could reuse the element with the new vars? then
> > > > I would only have made one call as long as I don't change the
> > > > source... smashing!  now how to write that... :-)  any more ideas on
> > > > this?
>
> > > > thanks for the help...
> > > > jeremyBass
>
> > > > On Sep 28, 8:31 pm, ricardobeat <ricardob...@gmail.com> wrote:
>
> > > > > If the element is already being cloned instead of being created again,
> > > > > there is no fix. You can create/clone/append/modify an image or object
> > > > > tag, but it will always need to request it's content from the server.
> > > > > And using dozens of flash objects to round corners doesn't seem like a
> > > > > good idea...
>
> > > > > On Sep 28, 6:14 pm, jeremyBass <dbjer...@cableone.net> wrote:
>
> > > > > > I'm so it is be cahced but the HTTP requests on the dead download is
> > > > > > still high... I'm not sure how to stop it frm makeing the requests
> > > > > > sice the first time it runs through the functions it has downloaded
> > > > > > the swf so no need to make a new HTTP request... any ideas on this?
>
> > > > > > On Sep 28, 10:56 am, jeremyBass <dbjer...@cableone.net> wrote:
>
> > > > > > > Does anyone have an idea on this... or , and I don't do this well and
> > > > > > > lot lol, but am I not being clear?  I really need to figure this
> > > > > > > out... Thanks
> > > > > > > jeremyBass
>
> > > > > > > On Sep 27, 3:21 pm, jeremyBass <dbjer...@cableone.net> wrote:
>
> > > > > > > > Hello, I want to reduce the header calls for a flash file used
> > > > > > > > repeatedly on a page.  There are 24 HTTP requests for a file that is
> > > > > > > > already downloaded.. So My question is how would I call it once and
> > > > > > > > then not again for the rest of the page?
>
> > > > > > > > the code area is like this
>
> > > > > > > > ex.1)
>
> > > > > > > > src: (p.path || '').replace(/([^\/])$/, '$1/') + (p.font ||
> > > > > > > > ele.css('fontFamily').replace(/^\s+|\s+$|,[\S|\s]+|'|"|(,)\s+/g,
> > > > > > > > '$1')).replace(/([^\.][^s][^w][^f])$/, '$1.swf'),
>
> > > > > > > > ex.2)
>
> > > > > > > > var SORUCE = 'Scripts/flash/rounded_rectangle.swf';
> > > > > > > > $('.Round_gen53').attr('rel',''+SORUCE +':::transparent:
> > > > > > > > 45:0:100:57:0:0x000000:0xecffa4:15:2:2');
> > > > > > > > $('.Round_gen54').attr('rel',''+SORUCE +':::transparent:
> > > > > > > > 45:0:100:57:0:0x000000:0xecffa4:15:2:2');
>
> > > > > > > > and the functions get ran for each element... but I don't see why the
> > > > > > > > repeated HTTP request is needed and it's slowing my site down... So
> > > > > > > > says YSlow lol.... Any ideas on how to fix/write this? thank you for
> > > > > > > > the help.
> > > > > > > > jeremyBass
>
> > > > > > > > Some other things...
> > > > > > > > Configure ETags
> > > > > > > > Expires header
> > > > > > > > are set
> > > > > > > > as well as
>
> > > > > > > > <FilesMatch "\.(js|css|swf|gz)$">
> > > > > > > >  Header set Cache-Control "max-age=604800"
> > > > > > > > </FilesMatch>
>
> > > > > > > > Thank again- Hide quoted text -
>
> > > > > > > - Show quoted text -- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -