[jQuery] Re: Insert variable into a selector

2008-09-22 Thread suntrop

Hi Michael, I didn't want to screw things up with the complete code,
because I thought it is a pretty simple thing :-)

So here is the whole code:
(I haven't a live page, it is only on my local machine)
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; xml:lang="de">


Werbetrommel





{literal}
$(document).ready(function() {
$('.customer').hide();

$("h1").click(function() {
$(this).next().slideToggle();
});

$('#displayAll').click(function() {
$('.customer').each(function() {
$(this).show();
});
return false;
});
$('#displayNone').click(function() {
$('.customer').each(function() {
$(this).hide();
});
return false;
});

// Make Favorite
$('.makeFavorite').click(function() {
var id = this.id;
var favimg = "favorites";
$.ajax({
type: "POST",
url: "make_favorite.php",
data: "id=" + $(this.id),
success: function(msg) {
alert('Data saved: ' + msg);
$('h1 a#'+id+' img').attr({src 
: "images/"+favimg+".png"});
}
});
return false;
});
});
{/literal}













a
b
y
z









Alle einblenden - Alle ausblenden

{foreach from=$eintrag item=inhalt}
{$inhalt.firma} 


Empfänger
{$inhalt.name}
{$inhalt.adresse|nl2br}
{$inhalt.email}{$inhalt.website}



Mailing
Wurf: {$inhalt.wurf}Mailing: {$inhalt.mailing}
Zeitpunkte
Gesendet I: 
{$inhalt.gesendet_1}Gesendet II:
{$inhalt.gesendet_2}Gesendet III: {$inhalt.gesendet_3}



Status
Status: {$inhalt.status}FI: {$inhalt.feuer_index}



Feedback
1. Kontakt: 
{$inhalt.erstkontakt}1. Kontakt Typ:
{$inhalt.erstkontakt_typ}Termin: {$inhalt.termin}Interessiert an: {$inhalt.interessiert_an}
Infos
Mängel/VorschlägeKommentar






{/foreach}
 

[jQuery] Re: about $(document).ready()

2008-09-22 Thread 立体风
哦,谢谢,呵呵,收获不小,想不到这里国内的朋友还不少啊!

2008/9/21 Xinhao Zheng <[EMAIL PROTECTED]>

> 你好,
>
> 你可以为ready事件定义多个函数。也就是你那样写是可以的。
> 至于你说的合在一起和分开是有区别的,至少我亲身体验的是我是能合在一起就合在一起,需要分开就不得不分开。
> 不过分开写的时候,最好每个函数彼此之间不要相互依赖。
>
>
> Xinhao Zheng
>
> SGL中文Blog: http://blog.cjcht.com
> SGL中文文档: http://wiki.cjcht.com
> SGL中文Group:http://groups.google.com/group/seagull_forum
>
>
> 2008/9/21 立体风 <[EMAIL PROTECTED]>
>
> 不好意思,英语不好见笑了,我实际是想问问:
>>  放在$(document).ready(x)中的函数多少有限制吗?比如:
>>$(document).ready(function(){
>>  a();
>>  b();
>>  c();
>>});
>>   上面是放了3个函数,如果这样写:
>>$(document).ready(function(){
>>  a();
>>});
>>$(document).ready(function(){
>>  b();
>> });
>>$(document).ready(function(){
>>  c();
>>});
>> 在这里a(); b(); c();是jquery的一个效果或事件,和到一起和分开有区别吗?
>> 谢谢!
>>
>>
>>
>>
>>
>> 2008/9/18 ~flow <[EMAIL PROTECTED]>
>>
>>
>>> 敬��原��但是文字上大概有�c儿不太清楚。
>>>
>>> `$(document).ready(x)` [EMAIL PROTECTED]
>>> 如果document已��完成的�r候script�f`$(document).ready(x)`的��,那它的引��`x`立即被execute。
>>>
>>> 一个document ready的引��function可以有多少clauses,也可以在一个script�Y面define多少document
>>> ready,它��都�⒈��绦小�
>>>
>>> 例。$(document).ready(function(){alert('helo')})
>>>
>>> 以上。
>>>
>>> On Sep 18, 1:43 pm, "立体风" <[EMAIL PROTECTED]> wrote:
>>> > Hello all,
>>> > Why sometimes with time, and sometimes "$(document).ready()" with many
>>> > times?
>>>
>>
>>
>


[jQuery] Re: event delegation in jQuery - delegate vs listen vs ?

2008-09-22 Thread Wilfred Nas

if you have to sell it, just mention speed, that increases by a lot.
or the fact that elements that are added dynamically have their
handlers on standby. (warning plug) look at my article about it with
examples at the bottom

http://www.wnas.nl/?p=238

> > From: rolfsf
>
> > Thanks Mike,
>
> > I guess what I'm wrestling with, is what advantages the
> > plugins offer (I'm not that adept at javascript, but I'm
> > hoping to 'sell' the concept to others who are more adept at
> > it). We have some big data tables with lots of clicks,
> > sometimes expanding rows, sometimes hovers or clueTips, and
> > sometimes the clicks will trigger a jqModal- controlled
> > window (hence my interest in how to work with jqModal in this
> > event delegation scenario).
>


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread Michael Geary

No one could possibly have any idea what's wrong there (other than a lucky
guess), because we're not seeing your actual code.

Forget about PHP for the moment and look at what you get back from a View
Source in the browser. That's all the browser and its JavaScript interpreter
know about - your PHP source is out of the picture at that point. Do you see
what's wrong there?

If not, then please post a link to a live test page (not just a code
snippet) and I'm sure someone will be able to spot the problem.

-Mike

> From: suntrop
> 
> When write:
> $('#' + id + ' img').attr("src", "images/favorites.png"); . it works.
> alert (msg) says "favorites".
> 
> There must be something wrong with msg. If the variable is 
> defined before var favimg = "favorites"; and I insert favimg 
> it works just fine.
> 
> What could be wrong with msg? msg is what I echo back in my PHP code.
> I don't know if this is the appropriate way.

> On 22 Sep., 13:34, MorningZ <[EMAIL PROTECTED]> wrote:
> > "But the image isn't replaced correctly"
> >
> > Perhaps try changing this line instead
> >
> > $('#' + id + ' img').attr("src", "images/"+msg+".png");
> >
> > There's no reason why that (or your line for that matter) wouldn't 
> > work as long as the selector finds something and the value of the 
> > "src" is a valid path on your server
> 



[jQuery] Re: [validate] how to test text against a bad word list?

2008-09-22 Thread tobaco

doh! (http://www.fortunecity.com/lavendar/poitier/135/doh.wav)
(hätte ich auch selber drauf kommen können …)

thanks! works great!




On 22 Sep., 16:03, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Try this:
>
> return !new RegExp(badwordlist.join('|')).test(value);
>
> Jörn
>
> On Mon, Sep 22, 2008 at 3:50 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> > hm, i tried it this way,
>
> >                var badwordlist = new Array("Nice Site", "Good Work", "xxx",
> > "url=http", "drugs", "aciphex", "nude");
>
> >                jQuery.validator.addMethod("badWord", function(value) {
> >                        return new RegExp('!/' + badwordlist.join('|') + 
> > '/').test(value);
> >                }, "Verdacht auf Spam-Versuch. Bitte passen Sie Ihren 
> > Kommentar
> > an.");
>
> > but now it works in the opposite way. the textarea is now only valid,
> > if i enter one of the bad words …
>
> > this
>
> > return !/nice site|good work|xxx|aciphex|url=http|nude/.test(value);
>
> > works fine.
>
> > On 22 Sep., 14:32, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > wrote:
> >> Sure. You can create a regexes on the fly with new RegExp("bla") and
> >> use that instead of the inline regex /bla|blu/.
>
> >> Jörn
>
> >> On Mon, Sep 22, 2008 at 1:37 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> >> > uh, that was fast!
> >> > thx, i will give it a try.
>
> >> > aehm, is it possible to put the bad word in an array and test this.
>
> >> > On 22 Sep., 13:31, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> >> > wrote:
> >> >> return !/bad|word|must|not|match/.test(value);
>
> >> >> Jörn
>
> >> >> On Mon, Sep 22, 2008 at 1:25 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> >> >> > hi,
>
> >> >> > i'm using the excellent validate-plugin and it works like a charm.
> >> >> > now i want to test the text in a textarea against a list of bad words.
>
> >> >> > how must be the syntax of the custom validation rule?
> >> >> > i'm very bad in regex …
>
> >> >> > thanks in advance,
>
> >> >> > tobaco


[jQuery] Re: Help refactoring code for css sprite animation

2008-09-22 Thread Michael Geary

That's great, I'm glad it worked!

Just a minor point of terminology: There's actually no recursion in that
code, although it does have a recursive "feel" to it. The callback functions
are called at a later time after the original function has returned.
Recursion would be when you have a function calling itself *before* it
returns.

-Mike

> From: gogojuice
> 
> Thanks Michael
> 
> Your code worked right off the copy and paste.   I knew there was a
> recursive procedure in there somewhere, but I'm just getting 
> up to speed with Javascript after years of ignoring it due to 
> the pain and suffering involved in writing cross platform 
> stuff.  Jquery has made me want to learn again.
> 
> Thanks Again



[jQuery] Re: load progress on background image...

2008-09-22 Thread [EMAIL PROTECTED]

well i think i found the answer, for the record:

var imageObj = new Image();
$(imageObj).attr("src",imagePath).load(function(){
$("#loadingGal").hide();
});

$("#leftCol").css("background-image","url("+imagePath+")");


Since the load command does not take into account background images, i
loaded up the same image in an image object, and traced that at the
same time.  i figured if it is loaded in one place, it will work.

bah.



On Sep 20, 1:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Is it possible to detect this?  I've searched everywhere.
>
> What i have is an image gallery that changes the background image, so
> it will be liquid with different resolutions.
> Id like to trace it so i can attach a load image and text.
>
> $("#leftCol").css("background-image","none").hide().css("background-
> image","url("+imagePath+")").fadeIn(2000);


[jQuery] Re: [validate] how to test text against a bad word list?

2008-09-22 Thread Jörn Zaefferer
Try this:

return !new RegExp(badwordlist.join('|')).test(value);

Jörn

On Mon, Sep 22, 2008 at 3:50 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> hm, i tried it this way,
>
>var badwordlist = new Array("Nice Site", "Good Work", "xxx",
> "url=http", "drugs", "aciphex", "nude");
>
>jQuery.validator.addMethod("badWord", function(value) {
>return new RegExp('!/' + badwordlist.join('|') + 
> '/').test(value);
>}, "Verdacht auf Spam-Versuch. Bitte passen Sie Ihren Kommentar
> an.");
>
> but now it works in the opposite way. the textarea is now only valid,
> if i enter one of the bad words …
>
> this
>
> return !/nice site|good work|xxx|aciphex|url=http|nude/.test(value);
>
> works fine.
>
> On 22 Sep., 14:32, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> wrote:
>> Sure. You can create a regexes on the fly with new RegExp("bla") and
>> use that instead of the inline regex /bla|blu/.
>>
>> Jörn
>>
>> On Mon, Sep 22, 2008 at 1:37 PM, tobaco <[EMAIL PROTECTED]> wrote:
>>
>> > uh, that was fast!
>> > thx, i will give it a try.
>>
>> > aehm, is it possible to put the bad word in an array and test this.
>>
>> > On 22 Sep., 13:31, "Jörn Zaefferer" <[EMAIL PROTECTED]>
>> > wrote:
>> >> return !/bad|word|must|not|match/.test(value);
>>
>> >> Jörn
>>
>> >> On Mon, Sep 22, 2008 at 1:25 PM, tobaco <[EMAIL PROTECTED]> wrote:
>>
>> >> > hi,
>>
>> >> > i'm using the excellent validate-plugin and it works like a charm.
>> >> > now i want to test the text in a textarea against a list of bad words.
>>
>> >> > how must be the syntax of the custom validation rule?
>> >> > i'm very bad in regex …
>>
>> >> > thanks in advance,
>>
>> >> > tobaco
>


[jQuery] Re: [validate] how to test text against a bad word list?

2008-09-22 Thread tobaco

hm, i tried it this way,

var badwordlist = new Array("Nice Site", "Good Work", "xxx",
"url=http", "drugs", "aciphex", "nude");

jQuery.validator.addMethod("badWord", function(value) {
return new RegExp('!/' + badwordlist.join('|') + 
'/').test(value);
}, "Verdacht auf Spam-Versuch. Bitte passen Sie Ihren Kommentar
an.");

but now it works in the opposite way. the textarea is now only valid,
if i enter one of the bad words …

this

return !/nice site|good work|xxx|aciphex|url=http|nude/.test(value);

works fine.

On 22 Sep., 14:32, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Sure. You can create a regexes on the fly with new RegExp("bla") and
> use that instead of the inline regex /bla|blu/.
>
> Jörn
>
> On Mon, Sep 22, 2008 at 1:37 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> > uh, that was fast!
> > thx, i will give it a try.
>
> > aehm, is it possible to put the bad word in an array and test this.
>
> > On 22 Sep., 13:31, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > wrote:
> >> return !/bad|word|must|not|match/.test(value);
>
> >> Jörn
>
> >> On Mon, Sep 22, 2008 at 1:25 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> >> > hi,
>
> >> > i'm using the excellent validate-plugin and it works like a charm.
> >> > now i want to test the text in a textarea against a list of bad words.
>
> >> > how must be the syntax of the custom validation rule?
> >> > i'm very bad in regex …
>
> >> > thanks in advance,
>
> >> > tobaco


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread MorningZ

are you sure there is no white space getting returned in your echo?

if you have a line break (which you can't "see" in the returned value)
that could be throwing off the img src tag

maybe wash the returned value through a function stripping off leading
and trailing whitespace

http://www.google.com/search?hl=en&q=javascript+strip+whitespace





[jQuery] Re: jScrollPane and fadeIn

2008-09-22 Thread RitchieTheBrit

Thanks for your reply dude.

I actually had the scripts grouped like that, but I wasn't sure if
that was causing the problems, so I split them again, cheers for
clarifying that for me.

Anyway, I still have the same problem.  If the contentContainer DIV is
set to fadeIn, it will render any contents within it fine, until the
jScrollPane class is applied to the child DIV (mainContent).  This
causes mainContent not to render.  I have tried setting mainContent to
display:block and that had no effect.

Conversly, if I disable the fadeIn effect on the contentContainer DIV,
the mainContent DIV displays fine, and CSS scrollbars render fine.

I have uploaded all three configurations to my server...

http://graham-russell.co.uk/misc/newSite/index_1.html  <- jScrollPane
Disabled, fadeIn Enabled
http://graham-russell.co.uk/misc/newSite/index_2.html  <- jScrollPane
Enabled, fadeIn Disabled
http://graham-russell.co.uk/misc/newSite/index_3.html  <- jScrollPane
Enabled, fadeIn Enabled

Any ideas? I'm going to carry on experimenting myself, I'll repost if
I find a solution.

Cheers guys!

-R.

On Sep 21, 10:46 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
> You should apply the fadeIn effect to the element that contains both
> the content DIV and the jScrollPane controls, either
> #jScrollPaneContainer or #containerContent. Applying the effect to the
> DIV in use by jScrollPane will override it's changes.
>
> Also, jQuery provides a function for use in place of the window.onload
> event, and there's no need to keep your scripts separate.
>
> 
> $(document).ready(function(){
>
>    $('.scroll-pane').jScrollPane();
>    $("#containerContent").fadeIn(2000);
>
> });
>
> 
>
> On Sep 21, 6:56 am, RitchieTheBrit <[EMAIL PROTECTED]> wrote:
>
> > Hey guys!  I've searched everywhere before posting here, but I've
> > found nothing.
>
> > Anyway, I have a page that fades in a DIV on page load using fadeIn.
> > I tried to apply the jScrollPane effect to the div, but it seems that
> > the fadeIn effect breaks it.
>
> > Is there a way around this?  Below is the way I have applied the code:
>
> > 
> > $(function()
> > {
> >         $('.scroll-pane').jScrollPane();
>
> > });
>
> > 
> > 
> > window.onload = function()
> > {
> >  $("div#mainContent").fadeIn(2000);}
>
> > 
>
> > I'm a totaly newb, so I'm not too sure if I am calling the functions
> > incorrectly.  I have tried the opposite order as well.  A demo of the
> > page can be found athttp://graham-russell.co.uk/misc/newSite/
>
> > I am running jQuery 1.2.6 minified.
>
> > Many thanks guys!
>
> > -Ritchie.
>
>


[jQuery] Re: jEditable Clone Referring to the Original Element

2008-09-22 Thread Wayne

Thanks, Mike. This info helps. Great work, btw.

-Wayne

On Sep 20, 12:22 pm, Mika Tuupola <[EMAIL PROTECTED]> wrote:
> On Sep 19, 2008, at 6:20 PM, Wayne wrote:
>
> > In short, I can clone jEditable items, but I can't edit them in place
> > without a page reload and rewriting from the server side. Am I
> > ignoring something or do I need to reset a binding somewhere when I do
> > the DOM modification?
>
> This should help:
>
> http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...
>
> basically you need to rebind events to cloned elements.
>
> --
> Mika Tuupolahttp://www.appelsiini.net/


[jQuery] Error when trying to load the carousel.html

2008-09-22 Thread macmike

i copied over the files into a directory on my webspace and get the
following error when trying to access the carousel.html.

Error on the jquery.agile_carousel-beta.1.zip:

Fatal error: Call to undefined function: filter_var() in /homepages/14/
d227853429/htdocs/caro1/make_slides.php on line 9

Error on the jquery.agile_carousel-beta.2.0.zip:


Fatal error: Call to undefined function: filter_var() in /homepages/14/
d227853429/htdocs/caro2/make_slides.php on line 17

macmike



[jQuery] help needed with new node replace

2008-09-22 Thread redcom

If anyone knows a jQuery way to replace a node and return the new node
object that would be great (replaceWith returns the old object)


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread suntrop

When write:
$('#' + id + ' img').attr("src", "images/favorites.png");
… it works.
alert (msg) says "favorites".

There must be something wrong with msg. If the variable is defined
before var favimg = "favorites"; and I insert favimg it works just
fine.

What could be wrong with msg? msg is what I echo back in my PHP code.
I don't know if this is the appropriate way.




On 22 Sep., 13:34, MorningZ <[EMAIL PROTECTED]> wrote:
> "But the image isn't replaced correctly"
>
> Perhaps try changing this line instead
>
> $('#' + id + ' img').attr("src", "images/"+msg+".png");
>
> There's no reason why that (or your line for that matter) wouldn't
> work as long as the selector finds something and the value of the
> "src" is a valid path on your server


[jQuery] Re: [validate] how to test text against a bad word list?

2008-09-22 Thread Jörn Zaefferer
Sure. You can create a regexes on the fly with new RegExp("bla") and
use that instead of the inline regex /bla|blu/.

Jörn

On Mon, Sep 22, 2008 at 1:37 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> uh, that was fast!
> thx, i will give it a try.
>
> aehm, is it possible to put the bad word in an array and test this.
>
>
>
>
> On 22 Sep., 13:31, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> wrote:
>> return !/bad|word|must|not|match/.test(value);
>>
>> Jörn
>>
>> On Mon, Sep 22, 2008 at 1:25 PM, tobaco <[EMAIL PROTECTED]> wrote:
>>
>> > hi,
>>
>> > i'm using the excellent validate-plugin and it works like a charm.
>> > now i want to test the text in a textarea against a list of bad words.
>>
>> > how must be the syntax of the custom validation rule?
>> > i'm very bad in regex …
>>
>> > thanks in advance,
>>
>> > tobaco
>


[jQuery] Re: [validate] how to test text against a bad word list?

2008-09-22 Thread tobaco

uh, that was fast!
thx, i will give it a try.

aehm, is it possible to put the bad word in an array and test this.




On 22 Sep., 13:31, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> return !/bad|word|must|not|match/.test(value);
>
> Jörn
>
> On Mon, Sep 22, 2008 at 1:25 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> > hi,
>
> > i'm using the excellent validate-plugin and it works like a charm.
> > now i want to test the text in a textarea against a list of bad words.
>
> > how must be the syntax of the custom validation rule?
> > i'm very bad in regex …
>
> > thanks in advance,
>
> > tobaco


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread MorningZ

"But the image isn't replaced correctly"

Perhaps try changing this line instead

$('#' + id + ' img').attr("src", "images/"+msg+".png");

There's no reason why that (or your line for that matter) wouldn't
work as long as the selector finds something and the value of the
"src" is a valid path on your server


[jQuery] Re: ajax request with datatype:script

2008-09-22 Thread david

Hi,

What do you get from the server side ?
I think you are getting a json structure. But this is text for
javascript till you make eval;
instead of the ajax function try getjson.
Best regards,
David

On Sep 22, 7:04 am, "seo++" <[EMAIL PROTECTED]> wrote:
> I am trying to insert array elements through ajax request, these
> elements are also arrays or multidimensional arrays. here is an
> example
>
> main script :
> var list = [];
> $.ajax({ type: "POST",
>                      url: 'http://example.com/ids.js',
>                      data: "id=1" ,
>                      dataType: "script",
>                      success: function(data){
>                         alert( list[1][0] );
>                        }
>                      });
>
> ids.js contents:
> list[1] = [['aaa', 'bbb'], ['ccc', 'ddd']];
>
> that would produce ' list is undefined' error
> but changing datatype to 'html' and adding eval() would work fine
> var list = [];
> $.ajax({ type: "POST",
>                      url: 'http://example.com/ids.js',
>                      data: "id=1" ,
>                      dataType: "html",
>                      success: function(data){
>                         eval( data);
>                         alert( list[1][0] );
>                        }
>                      });
>
> any ideas what am i doing wrong ?


[jQuery] Re: [validate] how to test text against a bad word list?

2008-09-22 Thread Jörn Zaefferer
return !/bad|word|must|not|match/.test(value);

Jörn

On Mon, Sep 22, 2008 at 1:25 PM, tobaco <[EMAIL PROTECTED]> wrote:
>
> hi,
>
> i'm using the excellent validate-plugin and it works like a charm.
> now i want to test the text in a textarea against a list of bad words.
>
> how must be the syntax of the custom validation rule?
> i'm very bad in regex …
>
>
> thanks in advance,
>
> tobaco
>


[jQuery] [validate] how to test text against a bad word list?

2008-09-22 Thread tobaco

hi,

i'm using the excellent validate-plugin and it works like a charm.
now i want to test the text in a textarea against a list of bad words.

how must be the syntax of the custom validation rule?
i'm very bad in regex …


thanks in advance,

tobaco


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread suntrop

Thanks Erik. It helped! The id is inserted correctly.

But the image isn't replaced correctly.

What code should I sow you more Makisa? The other code isn't affected
with this. What do you mean?

On 22 Sep., 10:26, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> you concatenate a string with an object..
>
> On 22 Sep., 10:16, suntrop <[EMAIL PROTECTED]> wrote:
>
> > This is the JS code:
> > $('.makeFavorite').click(function() {
> > $.ajax({
> > type: "POST",
> > url: "make_favorite.php",
> > data: "id=" + $(this.id),
> > success: function(msg) {
> > alert('Data saved: ' + msg);
> > $('h1 a#' + this.id + ' img').attr({src : 
> > "images/"+msg+".png"});
> > }
> > });
> > return false;});
>
> > The HTML code:
> > {$ent.firma}  > id="{$ent.id}" title="Save favorite"> > alt="" />
>
> > Both variables don't do what what I expect them to do. The first
> > doesn't find the correct target/id and the seccond doesn't insert the
> > image correctly. But if I write down the id and the true path it works
> > fine.
>
> > What do I have to change?
>
> > On 22 Sep., 05:42, ricardobeat <[EMAIL PROTECTED]> wrote:
>
> > > I can't get it either, what are you trying to accomplish?
>
> > > $('h1 a#' + this.id') is not logical, you first need to reference some
> > >  element to get it's ID, but in doing that you already wrote the
> > > ID...
>
> > > On Sep 21, 11:16 pm, FrenchiINLA <[EMAIL PROTECTED]> wrote:
>
> > > > i think your problem is this.id, you have to show the entire code in
> > > > order for us to see what does this mean. try just to add a alert for
> > > > example to see what you get for this.id
>
> > > > On Sep 21, 7:38 am, suntrop <[EMAIL PROTECTED]> wrote:
>
> > > > > HI there,
>
> > > > > I want to insert two variables into the selector and an attribute. But
> > > > > it doesn't work.
>
> > > > > $('h1 a#' + this.id + ' img').attr({src : "images/" + msg + ".png"});
>
> > > > > I looked through various tutorials but couldn't find an answer to
> > > > > this.
>
> > > > > The first variable comes from the object's ( element) id and the
> > > > > seccond is a response from an php script.
>
> > > > > Can somebody please help me?- Zitierten Text ausblenden -
>
> > - Zitierten Text anzeigen -


[jQuery] [sites using jQuery] adobe.com

2008-09-22 Thread spinnach


dunno if anybody noticed, but adobe is using jQuery on some of their pages:

http://opensource.adobe.com/wiki/display/site/Projects

dennis.


[jQuery] Re: JSON data issue in IE | Language Translation

2008-09-22 Thread Arif

Even I got the issue, it's not been rendering because of French
accented characters in IE.

So what do I need to change the JSON character encoding?

P.S: I don't have server control, can change the front end layer
(xhtml/css/js/json) only, and will not be able to write any server
side code otherwise I could have easily done it.

Many thanks
Mohammed Arif
http://www.mohammedarif.com

On Sep 22, 11:12 am, Arif <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Hope, you all would be doing well.
>
> I am trying to create a language translation utility using jQuery for
> some specific words only, seems working fine in Firefox but don’t do
> well in IE 6/7.
>
> Given is the JSON file, where I map headings which needs to be
> translated in French.
>
> JSON Data:
> {
>   "download" : "télécharger",
>   "categories" : "sujets d'actualité",
>   "recent_comments" : "mais que l'histoire de l'",
>   "recent posts" : "Messages Récents",
>   "also worthy" : "aussi digne",
>   "archieves" : "archives",
>
> }
>
> I am able to load my JSON file successfully using $.getJSON(), it
> translates in FF but does not do the same in IE 6/7.
>
> jQuery Method:
> function loadJSON(){
>         $.getJSON("json/data_ca_fr.json", function(json){
>                 $(".json_trans").each(function(i){ //getting all the headings 
> to
> translate
>                         switch($(".json_trans")[i].innerHTML) {
>                           case "Download": // Start here if 
> $(".json_trans")[i].innerHTML
> == "download"
>                                 $(".json_trans")[i].innerHTML = 
> json.download;                                break;// Stop
> here
>                           case "Categories": // Start here if 
> $(".json_trans")[i].innerHTML
> == "download"
>                                 $(".json_trans")[i].innerHTML = 
> json.categories;
>                                 break;// Stop here
>                           default
>                                 break;
>                         }
>                 })
>         });
>
> }
>
> I am just comparing English words in the page through innerHTML
> because jQuery html() return the first array index only , defined
> span tag with .json_trans class for picking up all the required spans
> and do the translation.
>
> I know, it’s not the robust way to do the language translation  but
> does require for client and it’s not AJAX at all, just calling the
> json file on dom ready.
>
> Any quick pointer/ suggestion should be appreciated.
>
> Thanks for your time
> Mohammed Arifhttp://www.mohammedarif.com


[jQuery] Re: Help refactoring code for css sprite animation

2008-09-22 Thread gogojuice


Thanks Michael

Your code worked right off the copy and paste.   I knew there was a
recursive procedure in there somewhere, but I'm just getting up to speed
with Javascript after years of ignoring it due to the pain and suffering
involved in writing cross platform stuff.  Jquery has made me want to learn
again.

Thanks Again 
-- 
View this message in context: 
http://www.nabble.com/Help-refactoring-code-for-css-sprite-animation-tp19597457s27240p19604365.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Insert variable into a selector

2008-09-22 Thread [EMAIL PROTECTED]

you concatenate a string with an object..

On 22 Sep., 10:16, suntrop <[EMAIL PROTECTED]> wrote:
> This is the JS code:
> $('.makeFavorite').click(function() {
>         $.ajax({
>                 type: "POST",
>                 url: "make_favorite.php",
>                 data: "id=" + $(this.id),
>                 success: function(msg) {
>                         alert('Data saved: ' + msg);
>                         $('h1 a#' + this.id + ' img').attr({src : 
> "images/"+msg+".png"});
>                 }
>         });
>         return false;});
>
> The HTML code:
> {$ent.firma}  id="{$ent.id}" title="Save favorite"> alt="" />
>
> Both variables don't do what what I expect them to do. The first
> doesn't find the correct target/id and the seccond doesn't insert the
> image correctly. But if I write down the id and the true path it works
> fine.
>
> What do I have to change?
>
> On 22 Sep., 05:42, ricardobeat <[EMAIL PROTECTED]> wrote:
>
>
>
> > I can't get it either, what are you trying to accomplish?
>
> > $('h1 a#' + this.id') is not logical, you first need to reference some
> >  element to get it's ID, but in doing that you already wrote the
> > ID...
>
> > On Sep 21, 11:16 pm, FrenchiINLA <[EMAIL PROTECTED]> wrote:
>
> > > i think your problem is this.id, you have to show the entire code in
> > > order for us to see what does this mean. try just to add a alert for
> > > example to see what you get for this.id
>
> > > On Sep 21, 7:38 am, suntrop <[EMAIL PROTECTED]> wrote:
>
> > > > HI there,
>
> > > > I want to insert two variables into the selector and an attribute. But
> > > > it doesn't work.
>
> > > > $('h1 a#' + this.id + ' img').attr({src : "images/" + msg + ".png"});
>
> > > > I looked through various tutorials but couldn't find an answer to
> > > > this.
>
> > > > The first variable comes from the object's ( element) id and the
> > > > seccond is a response from an php script.
>
> > > > Can somebody please help me?- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread [EMAIL PROTECTED]

shouldn't it be this.id instead of $(this.id)

On 22 Sep., 10:16, suntrop <[EMAIL PROTECTED]> wrote:
> This is the JS code:
> $('.makeFavorite').click(function() {
>         $.ajax({
>                 type: "POST",
>                 url: "make_favorite.php",
>                 data: "id=" + $(this.id),
>                 success: function(msg) {
>                         alert('Data saved: ' + msg);
>                         $('h1 a#' + this.id + ' img').attr({src : 
> "images/"+msg+".png"});
>                 }
>         });
>         return false;});
>
> The HTML code:
> {$ent.firma}  id="{$ent.id}" title="Save favorite"> alt="" />
>
> Both variables don't do what what I expect them to do. The first
> doesn't find the correct target/id and the seccond doesn't insert the
> image correctly. But if I write down the id and the true path it works
> fine.
>
> What do I have to change?
>
> On 22 Sep., 05:42, ricardobeat <[EMAIL PROTECTED]> wrote:
>
>
>
> > I can't get it either, what are you trying to accomplish?
>
> > $('h1 a#' + this.id') is not logical, you first need to reference some
> >  element to get it's ID, but in doing that you already wrote the
> > ID...
>
> > On Sep 21, 11:16 pm, FrenchiINLA <[EMAIL PROTECTED]> wrote:
>
> > > i think your problem is this.id, you have to show the entire code in
> > > order for us to see what does this mean. try just to add a alert for
> > > example to see what you get for this.id
>
> > > On Sep 21, 7:38 am, suntrop <[EMAIL PROTECTED]> wrote:
>
> > > > HI there,
>
> > > > I want to insert two variables into the selector and an attribute. But
> > > > it doesn't work.
>
> > > > $('h1 a#' + this.id + ' img').attr({src : "images/" + msg + ".png"});
>
> > > > I looked through various tutorials but couldn't find an answer to
> > > > this.
>
> > > > The first variable comes from the object's ( element) id and the
> > > > seccond is a response from an php script.
>
> > > > Can somebody please help me?- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -


[jQuery] Re: Unable to select input by value with variable

2008-09-22 Thread Robert

iwasclicked is a variable wich is way you have to do:
$('[EMAIL PROTECTED]"+iwasclicked+"]')

skankster napisał(a):
> Hello,
>
> I have a form with lots of radio buttons that all have the same name.
> I want to select the one that was clicked by its value. What I am
> doing is this:
>
> 
> $(document).ready(function() {
> $('input[name="weAreAllCalledTheSame"]').click(function () {
>   if ($(this).attr('checked')) {
>   iwasclicked = $(this).attr('value');
> alert ($('[EMAIL PROTECTED]').length);
> alert (iwasclicked);
>   };
>   });
> });
> 
>
> The variable iwasclicked has shows the value of the selected radio
> button. But I am not able to select the input element by its value
> with this variable: $('[EMAIL PROTECTED]')
>
> I hope you can help me and I am not too blind and stoopid.
>
> Thx
> Dirk


[jQuery] superfish style current top

2008-09-22 Thread waver

I'am using the navbar example. I would like to set another color for
the current top-level menu item if a submenu is selected current (like
a breadcrumb). I've put  in both the top-level
menu and the submenu. I've figured out how to change the submenu
current font color but I have trouble finding a solution for the top-
level menu. Here is my css code:

/*** adding the class sf-navbar in addition to sf-menu creates an all-
horizontal nav-bar menu ***/
.sf-navbar {
background: #fff;
height: 1.4em; /* totale hoogte */
padding-bottom: 0.0em; /* totale hoogte */

position:   relative;
}
.sf-navbar li {
background: #fff;
position:   static;

font:   12px Arial;
color:  #043882;
font-weight:bold;
text-transform: uppercase;

}
.sf-navbar a {
border-top: none;
}
.sf-navbar li ul {
width:  44em; /*IE6 soils itself without this*/
}
.sf-navbar li li, .sf-navbar li li a {
background: #fff;
position:   relative;

font:   10px Arial;
color:  #9c9e9f;
text-transform: uppercase;
}

.sf-navbar li li ul {
width:  13em; /* width van sub sub menu */

}
.sf-navbar li li li {
width:  100%;
}
.sf-navbar ul li {
width:  auto;
float:  left;
}
.sf-navbar a, .sf-navbar a:visited {
border: none;

}

.sf-navbar li:hover,
.sf-navbar li.sfHover,
.sf-navbar li li.current,
.sf-navbar li li.current a,
.sf-navbar a:focus, .sf-navbar a:hover, .sf-navbar a:active {
background: #fff;
color:  #1e7bbc; /* hoofdmenu hover color */
}
.sf-navbar ul li:hover,
.sf-navbar ul li.sfHover,
ul.sf-navbar ul li:hover li,
ul.sf-navbar ul li.sfHover li,
.sf-navbar ul a:focus, .sf-navbar ul a:hover, .sf-navbar ul a:active {
background: #fff;
color:  #1e7bbc; /* submenu hover color */
}
ul.sf-navbar li li li:hover,
ul.sf-navbar li li li.sfHover,
.sf-navbar li li.current li.current,
.sf-navbar ul li li a:focus, .sf-navbar ul li li a:hover, .sf-navbar
ul li li a:active {
background: #fff;
color:  #1e7bbc;
}
ul.sf-navbar .current ul,
ul.sf-navbar ul li:hover ul,
ul.sf-navbar ul li.sfHover ul {
left:   0; /* put sub sub back in view when hover */
top:1.5em; /* match top ul list item height */

}
ul.sf-navbar .current ul ul {
top:-999em; /* put sub sub out of view until hover 
*/
}

.sf-navbar li li.current > a {
font-weight:bold;
}

/*** point all arrows down ***/
/* point right for anchors in subs */
.sf-navbar ul .sf-sub-indicator { background-position: -10px -100px; }
.sf-navbar ul a > .sf-sub-indicator { background-position: 0 -100px; }
/* apply hovers to modern browsers */
.sf-navbar ul a:focus > .sf-sub-indicator,
.sf-navbar ul a:hover > .sf-sub-indicator,
.sf-navbar ul a:active > .sf-sub-indicator,
.sf-navbar ul li:hover > a > .sf-sub-indicator,
.sf-navbar ul li.sfHover > a > .sf-sub-indicator {
background-position: -10px -100px; /* arrow hovers for modern
browsers*/
}

/*** remove shadow on first submenu ***/
.sf-navbar > li > ul {
background: transparent;
padding: 0;
-moz-border-radius-bottomleft: 0;
-moz-border-radius-topright: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
}


[jQuery] Adding "Arrows" to a DropDownMenu based on Lists

2008-09-22 Thread Gordon Bergling

Good Morning Everyone,

I am struggling a few hours with a problem, which solution isn't that
easy as I initial though.
The following example list is generated by backend code.


 
 Home
 
 Folder
A
   
Page1

Page2

Folder B

 
   Page1
 
 
  Page2
 
 
  Page3
 
   
 

Thats only a shortened version. JQuery is used to create a horizontal
dropdown menu. Up to this part everything is working as expected.

To improve the usability I want to add two kinds of arrows to the
menu. One arrow down for the top elements and one arrow right for
child entries. That part should accomplished by the following
snippets.

$("ul > li > a.navlinkparent").css({
"background-image": "url(/img/nav_arrow_down.gif)",
"background-repeat": "no-repeat",
"background-position": "right center"
});

$("#nav ul > li > a.navsublinkparent").css({
"background-image": "url(/img/nav_arrow_right.gif)",
"background-repeat": "no-repeat",
"background-position": "right center"
});

The problem I am facing right know is, that not every parent has
childs and therefor it shouldn't get an arrow assigned. I tried
various filters but without any luck.

Does anyone has a hint on solving?

best regards,

Gordon


[jQuery] Re: simple wizard: stuck with first jquery usage

2008-09-22 Thread david

Hi,
You could give all the divs a certain class, for example wizard. At
the beginning make that just one will be visible.
For the next and back you could find the index of the div which is
visible with this function $('.wizard').index($('.wizard:visible))
Then you just make it invisible and the next or previous invisible.
Just be aware of the corner cases where you don't have next and back
(first and last).

Good luck,
David

On Sep 21, 8:08 am, claudes <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to make a simple wizard. I have gotten as far as hiding all
> divs aside from the first, and inserting the next and back buttons. I'm
> having problems assigning click function to next/back
>
> next should hide current div and revel next div
> back hides current and revels previous
>
> markup (simplified):
> 
> 
> 
> 
> 
>
> jquery:
> $(document).ready(function() {
>         // assign buttons to divs
>
>         $('#content div:not(:first)').hide();  
>
>         // hide divs    
>         //$('div.step-two').hide();
>                 //$('div.step-three').hide();
>
>         // insert buttons
>         var next = $(' #next Next ');
>         var back = $(' #back Back ');
>
>         $(next).insertAfter('#content div[class*=step]:not(:last) form');
>         $(back).insertAfter('#content div[class*=step]:gt(0) form');
>
>         //wizard functionality
>                 $(next).click(function () {
>                  $('div.step-one').hide(); });
>
>         /*$('div.step-two a.next').click (function () {
>                 $('div.step-two').hide();
>                 $('div.step-three').show();
>                 });
>
>         $('div.step-two a.back').click (function () {
>                 $('div.step-one').show();
>                 $('div.step-two').hide();
>
>         });
>
>         $('div.step-three a.back').click (function () {
>                 $('div.step-two').show();
>                 $('div.step-three').hide();
>
>         });     */
>
> });
>
> I've left my initial script where I was calling out each div...issue is,
> number of divs is uncertain, so script needs to take that into factor and
> not call out each click function as I was doing.
>
> Any help, any modification truly welcome. I'd like to keep it as
> progressively enhanced as possible; hence hiding divs from js and inserting
> next/back via DOM.
>
> Thanks.
> --
> View this message in 
> context:http://www.nabble.com/simple-wizard%3A-stuck-with-first-jquery-usage-...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: forms

2008-09-22 Thread david

Hi,
The easy option is if you could define what the maximum number of
addresses you can enter. For this you would not need javascript. CGI
(for example perl) would be sufficient. You would create a table of
input elements where each row represents an address.
If not it is a little complicated. You have to make a table with one
input row. Then when clicking on a button you have to add another row
in the table with input fields (with the append function).

Anyway on the server side you would get them in input fields (cgi-
>param). Afterwards you could push them into a hash.
This is a general answer.
Hope it helps,
David


On Sep 21, 10:58 pm, johnmiller <[EMAIL PROTECTED]> wrote:
> hello,
>
> right upfront, please let me apologize for my ignorance. i'm a server
> dude and got stuck with some front end work and obviously too stupid
> not only to figure it out but even to formulate the question. hence,
> let me give my "need" statement:
> i need an input form that gathers user info including one or more
> addresses. on top of it, i need to return these inputs in a hash table
> -like structure, e.g. {'username':'joe', ...{'street':"some lane',
> 'city':'some town', ...}, {'street':'dad's place', 'city':'boring
> village', ...}, ..., 'dob':'02/02/1985', ...}.
>
> as i said, i don;t even know what i need to type into google to find
> what i'm looking for. so any help, search terms, etc. are massively
> appreciated.
>
> many thanks,
> johnny


[jQuery] Re: Superfish navbar for Wordpress

2008-09-22 Thread kiper

Sweet!

That was a nice and simple solution. It works but I realized that I'll
have to change some of the CSS... :)

Many Thanks!

Müfit

On Sep 21, 9:57 am, "Joel Birch" <[EMAIL PROTECTED]> wrote:
> I just thought of a really simple solution for this. Before
> initialising Superfish simply dynamically add one common class to the
> elements that are of any of three WordPress classes.
>
> $('document').ready(function(){
>   $('ul.sf-menu')
>   
> .find('li.current_page_item,li.current_page_parent,li.current_page_ancestor')
>     .addClass('current')
>     .end()
>   .superfish({
>     pathClass : 'current'
>   });
>
> });
>
> Joel Birch.
>
> On 18/09/2008,kiper<[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Joel!
>
> > I am just happy if I can contribute to make Superfish even better!
>
> > All the best,
>
> > Müfit
>
> > On Sep 18, 5:29 am, "Joel Birch" <[EMAIL PROTECTED]> wrote:
> >> Hi Müfit,
>
> >> Thanks for your well-articulated thoughts on this. I agree that being
> >> able to specify more that one pathClass would be very useful for
> >> WordPress generated menus. I will aim to get this in as a Superfish
> >> feature as soon as possible, although I'm snowed under with work for
> >> the next few weeks.
>
> >> Thanks again for the great feedback. I wish I could offer more immediate
> >> help.
>
> >> Joel Birch.


[jQuery] JSON data issue in IE | Language Translation

2008-09-22 Thread Arif

Hi All,

Hope, you all would be doing well.

I am trying to create a language translation utility using jQuery for
some specific words only, seems working fine in Firefox but don’t do
well in IE 6/7.

Given is the JSON file, where I map headings which needs to be
translated in French.

JSON Data:
{
  "download" : "télécharger",
  "categories" : "sujets d'actualité",
  "recent_comments" : "mais que l'histoire de l'",
  "recent posts" : "Messages Récents",
  "also worthy" : "aussi digne",
  "archieves" : "archives",
}

I am able to load my JSON file successfully using $.getJSON(), it
translates in FF but does not do the same in IE 6/7.


jQuery Method:
function loadJSON(){
$.getJSON("json/data_ca_fr.json", function(json){
$(".json_trans").each(function(i){ //getting all the headings to
translate
switch($(".json_trans")[i].innerHTML) {
  case "Download": // Start here if 
$(".json_trans")[i].innerHTML
== "download"
$(".json_trans")[i].innerHTML = json.download;  
break;// Stop
here
  case "Categories": // Start here if 
$(".json_trans")[i].innerHTML
== "download"
$(".json_trans")[i].innerHTML = json.categories;
break;// Stop here
  default
break;
}
})
});
}

I am just comparing English words in the page through innerHTML
because jQuery html() return the first array index only , defined
span tag with .json_trans class for picking up all the required spans
and do the translation.

I know, it’s not the robust way to do the language translation  but
does require for client and it’s not AJAX at all, just calling the
json file on dom ready.

Any quick pointer/ suggestion should be appreciated.

Thanks for your time
Mohammed Arif
http://www.mohammedarif.com


[jQuery] Superfish and wordpress - menus show up only on first page...?

2008-09-22 Thread janaki

Hi everyone!
first off I'm a newbie using Superfish, but I just wanted to see if
anyone has had the following problem:

I was able to get the superfish vertical dropdown menu working on this
site for the front page; however,
when I use superfish for any sub pages it does not work; what happens
is that all the sub menus appear on the same level as the rest of the
menu items.

you can check it out here:
http://www.townofross.org
I'll have to take it down in a couple of hours...but hopefully someone
out there is still up!
here is what I did:

1.) created a css dropdown menu
2.) added jquery includes/style sheets to the head of each header
file(there is one for each page/main menu item)


thanks in advance, and I hope this makes sense!!


[jQuery] ajax request with datatype:script

2008-09-22 Thread seo++

I am trying to insert array elements through ajax request, these
elements are also arrays or multidimensional arrays. here is an
example

main script :
var list = [];
$.ajax({ type: "POST",
 url: 'http://example.com/ids.js',
 data: "id=1" ,
 dataType: "script",
 success: function(data){
alert( list[1][0] );
   }
 });

ids.js contents:
list[1] = [['aaa', 'bbb'], ['ccc', 'ddd']];

that would produce ' list is undefined' error
but changing datatype to 'html' and adding eval() would work fine
var list = [];
$.ajax({ type: "POST",
 url: 'http://example.com/ids.js',
 data: "id=1" ,
 dataType: "html",
 success: function(data){
eval( data);
alert( list[1][0] );
   }
 });

any ideas what am i doing wrong ?


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread Makisa

Hi Can you show more code? I think showing an alert would be a good
idea.

On Sep 22, 12:38 am, suntrop <[EMAIL PROTECTED]> wrote:
> HI there,
>
> I want to insert two variables into the selector and an attribute. But
> it doesn't work.
>
> $('h1 a#' + this.id + ' img').attr({src : "images/" + msg + ".png"});
>
> I looked through various tutorials but couldn't find an answer to
> this.
>
> The first variable comes from the object's ( element) id and the
> seccond is a response from an php script.
>
> Can somebody please help me?


[jQuery] Re: docs.jquery.com status update

2008-09-22 Thread coreyw

I hate to revive a more-or-less dead thread, but this problem is still
occurring as far as I can see.

The docs. subdomain doesn't just host the documentation, so the other
sources are of no use. It happens to host a good portion of the
content regarding release notes, download notes, tutorials, the
discussions, and credits.

If this were a non-tech-oriented community this might be
understandable, but really this is absurd. MediaTemple has had issues
with this for several months now. I think their time has run out. I'm
sure that between all of the people willing to help out a better
solution can be had.



On Jul 29, 8:40 am, Lance McCulley <[EMAIL PROTECTED]> wrote:
> I figure you're completely aware that docs.jquery.com is not
> responding, but I'm wondering if there is a status update?
>
> And, on a side note, how would I setup a loop to remove all child
> elements of a particular element?
>
> Thanks!
>
> -Lance


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread Erik Beeson
According to the docs, 'this' within a success callback is the "options"
object, so 'this.id' doesn't mean anything useful:
http://docs.jquery.com/Ajax/jQuery.ajax#options

Also, $(this.id) probably isn't anything useful either.

Maybe try this (untested):

$('.makeFavorite').click(function() {
   var id = this.id;
   $.ajax({
   type: "POST",
   url: "make_favorite.php",
   data: "id=" + id,
   success: function(msg) {
   alert('Data saved: ' + msg);
   $('#' + id + ' img').attr({src :
"images/"+msg+".png"});
   }
   });
   return false;
});

Hope it helps.

--Erik



On Mon, Sep 22, 2008 at 1:16 AM, suntrop <[EMAIL PROTECTED]> wrote:

>
> This is the JS code:
> $('.makeFavorite').click(function() {
>$.ajax({
>type: "POST",
>url: "make_favorite.php",
>data: "id=" + $(this.id),
>success: function(msg) {
>alert('Data saved: ' + msg);
> $('h1 a#' + this.id + ' img').attr({src :
> "images/"+msg+".png"});
>}
> });
>return false;
> });
> The HTML code:
> {$ent.firma}  id="{$ent.id}" title="Save favorite"> alt="" />
>
> Both variables don't do what what I expect them to do. The first
> doesn't find the correct target/id and the seccond doesn't insert the
> image correctly. But if I write down the id and the true path it works
> fine.
>
> What do I have to change?
>
> On 22 Sep., 05:42, ricardobeat <[EMAIL PROTECTED]> wrote:
> > I can't get it either, what are you trying to accomplish?
> >
> > $('h1 a#' + this.id') is not logical, you first need to reference some
> >  element to get it's ID, but in doing that you already wrote the
> > ID...
> >
> > On Sep 21, 11:16 pm, FrenchiINLA <[EMAIL PROTECTED]> wrote:
> >
> > > i think your problem is this.id, you have to show the entire code in
> > > order for us to see what does this mean. try just to add a alert for
> > > example to see what you get for this.id
> >
> > > On Sep 21, 7:38 am, suntrop <[EMAIL PROTECTED]> wrote:
> >
> > > > HI there,
> >
> > > > I want to insert two variables into the selector and an attribute.
> But
> > > > it doesn't work.
> >
> > > > $('h1 a#' + this.id + ' img').attr({src : "images/" + msg +
> ".png"});
> >
> > > > I looked through various tutorials but couldn't find an answer to
> > > > this.
> >
> > > > The first variable comes from the object's ( element) id and the
> > > > seccond is a response from an php script.
> >
> > > > Can somebody please help me?
>


[jQuery] Re: Case Insentitive Selectorys

2008-09-22 Thread Erik Beeson
Maybe try using filter and a regexp for the part that you want to be case
insensitive. Something like (very untested):
$(...).find('item').filter(function() { return this.name.match(new
RegExp(search, 'i')); }).each(function() {

});

I don't recall the syntax for accessing an XML attribute from javascript, so
the "this.name" part might be wrong. Maybe you need $(this).attr('name')
instead. Also, you might want to be doing more than just passing the search
into a RegExp, but you get the idea.

Also, maybe reconsider what you're trying to do. Maybe just return your xml
such that it's already been converted to lower case, then just do what you
were doing before except use search.toLowerCase() instead of just search.

Hope it helps.

--Erik



On Mon, Sep 22, 2008 at 12:35 AM, blockedmind <[EMAIL PROTECTED]> wrote:

>
> Nothing?
>
> On Sep 20, 5:22 pm, blockedmind <[EMAIL PROTECTED]> wrote:
> > I am making search in an xml file, but I don't get expected results
> > since jQuery selectors arecase-sensitive. I use something like
> >
> > $(returnedXml).find("item[name*='"+search+"']").each(function(){
> >
> > });
> >
> > How to make it INCASE-SENSITIVE?
>


[jQuery] Re: Insert variable into a selector

2008-09-22 Thread suntrop

This is the JS code:
$('.makeFavorite').click(function() {
$.ajax({
type: "POST",
url: "make_favorite.php",
data: "id=" + $(this.id),
success: function(msg) {
alert('Data saved: ' + msg);
$('h1 a#' + this.id + ' img').attr({src : 
"images/"+msg+".png"});
}
});
return false;
});
The HTML code:
{$ent.firma} 

Both variables don't do what what I expect them to do. The first
doesn't find the correct target/id and the seccond doesn't insert the
image correctly. But if I write down the id and the true path it works
fine.

What do I have to change?

On 22 Sep., 05:42, ricardobeat <[EMAIL PROTECTED]> wrote:
> I can't get it either, what are you trying to accomplish?
>
> $('h1 a#' + this.id') is not logical, you first need to reference some
>  element to get it's ID, but in doing that you already wrote the
> ID...
>
> On Sep 21, 11:16 pm, FrenchiINLA <[EMAIL PROTECTED]> wrote:
>
> > i think your problem is this.id, you have to show the entire code in
> > order for us to see what does this mean. try just to add a alert for
> > example to see what you get for this.id
>
> > On Sep 21, 7:38 am, suntrop <[EMAIL PROTECTED]> wrote:
>
> > > HI there,
>
> > > I want to insert two variables into the selector and an attribute. But
> > > it doesn't work.
>
> > > $('h1 a#' + this.id + ' img').attr({src : "images/" + msg + ".png"});
>
> > > I looked through various tutorials but couldn't find an answer to
> > > this.
>
> > > The first variable comes from the object's ( element) id and the
> > > seccond is a response from an php script.
>
> > > Can somebody please help me?


[jQuery] Re: Validate with bassistance local bug

2008-09-22 Thread ripcurlksm

Thank you, I will try that.

Regards,
Kevin

On Sep 20, 5:37 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Try to download the complete package, which includes the demo and it's
> PHP files for remote 
> validation:http://bassistance.de/jquery-plugins/jquery-plugin-validation/
>
> Jörn
>
> On Sat, Sep 20, 2008 at 2:23 AM,ripcurlksm<[EMAIL PROTECTED]> wrote:
>
> > On this demo:
> >http://jquery.bassistance.de/validate/demo/milk/
>
> > I cant get the email validation to work on the second try locally. The
> > above link works fine. If you submit an invalid email address it asks
> > you to reenter it. Great. So I try to move it locally.
>
> > I downloaded jQuery and the validation plugin. Everything works...
> > except if I try an invalid email.. it throws an error, so I fix it to
> > a valid email and hit submit... nothing.
>
> > As a second try, I visited the above link, and downloaded the entire
> > source using my browser... same issue. If you type the wrong email in
> > and try to fix it, it will never validate.
>
> > This demo works and this issue is not seen in the demo. What am I
> > doing wrong?
>
> > Regards,
> > Kevin


[jQuery] Re: Treeview problem with checkboxes in IE

2008-09-22 Thread Jörn Zaefferer
Can you build a testpage that doesn't require any browser plugins to
install first?

Jörn

On Mon, Sep 22, 2008 at 7:19 AM, mrhankey <[EMAIL PROTECTED]> wrote:
>
> I also just noticed that the problem goes away when I turn animation
> off (although the plus/minus icons still display erratically on the
> last parent node in the list).
>
> I have left animation on for now so that you can see the problem.
>
> On Sep 22, 12:10 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> wrote:
>> I don't see any checkboxed-tree on that page. Below the google earth
>> box are only navigation and print links.
>>
>> Jörn
>>
>> On Sat, Sep 20, 2008 at 10:43 PM, mrhankey <[EMAIL PROTECTED]> wrote:
>>
>> > The page is:
>> > test.cloudbase.org.nz/node/126
>>
>> > The list is below the google earth plugin. It is populated by a script
>> > in the page. It is running in Drupal 5.7 but I have patched it up to
>> > jQuery 1.2.6
>>
>> > Cheers
>>
>> > On Sep 21, 12:40 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
>> > wrote:
>> >> Could you post a testpage?
>>
>> >> On Sat, Sep 20, 2008 at 9:35 AM, mrhankey <[EMAIL PROTECTED]> wrote:
>>
>> >> > I have set up a tree usingTreeviewwhere each list item includes a
>> >> > checkbox input. This works perfectly on Firefox but withIE6 & 7
>> >> > every time I expand a tree branch the checkboxes in the branch all
>> >> > disappear almost immediately after the branch opens. Furthermore, when
>> >> > I mouse over a parent node one child checkbox immediately above and
>> >> > below the node reappear.
>>
>> >> > Has anyone else experienced this problem? Any solutions?
>


[jQuery] Re: Case Insentitive Selectorys

2008-09-22 Thread blockedmind

Nothing?

On Sep 20, 5:22 pm, blockedmind <[EMAIL PROTECTED]> wrote:
> I am making search in an xml file, but I don't get expected results
> since jQuery selectors arecase-sensitive. I use something like
>
> $(returnedXml).find("item[name*='"+search+"']").each(function(){
>
> });
>
> How to make it INCASE-SENSITIVE?


<    1   2