[jQuery] Re: Value adding to drop down

2009-07-17 Thread naz

i have changed '|' seperator still it is not working.:(

On Jul 16, 10:31 am, 刘永杰  wrote:
> change split character,not use '|'.
>
> 2009/7/16 naz 
>
>
>
>
>
> > hi
> > i m adding some values to drop down
> > by usind j query by this code
> > var programs=[];
> >  programs=data.split('|');
> > $('#p_course').length = 1;
> >  for(var i=0;i >  {
> >       var objDropdown =$('#p_course').get(0);
> >       var objOption = new Option(programs[i],programs[i]);
> >      objDropdown.options[objDropdown.length] = objOption;
> >  }
> > but when vales appear in drop down first value look like this
> > |BSIT
> > any body have any idea why it look like  this- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Value adding to drop down

2009-07-17 Thread naz

i m using internet explorar.and data value is SE,DLD etc i m getting
these values from db.

On Jul 16, 11:14 am, Jules  wrote:
> The code looks fine to me.  Could you post the data value?  What is
> the browser you are using?
>
> On Jul 16, 2:58 pm, naz  wrote:
>
>
>
> > hi
> > i m adding some values to drop down
> > by usind j query by this code
> > var programs=[];
> >  programs=data.split('|');
> > $('#p_course').length = 1;
> >   for(var i=0;i >   {
> >        var objDropdown =$('#p_course').get(0);
> >        var objOption = new Option(programs[i],programs[i]);
> >       objDropdown.options[objDropdown.length] = objOption;
> >  }
> > but when vales appear in drop down first value look like this
> > |BSIT
> > any body have any idea why it look like  this- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Looking for tooltip expert

2009-07-17 Thread Steve Tran
Hi there,
I used the plugin you mentioned to make a map tooltip in this site
http://herevietnam.vn
The code can be easily seen by viewing the source code.
Steve,

On Sat, Jul 18, 2009 at 1:58 AM, e...@uitenbogaard.nl
wrote:

>
> New on jQuery.
> I'am looking for dynamic tooltips when mouse comes over a hotspot (I
> need tooltips on several hotspots in one image) like the tooltip on
> this homepage: http://
> bassistance.de/jquery-plugins/jquery-plugin-tooltip/.
> (tooltip sticks to pointer - appears directly - fonts, colors, etc.
> can be manipulated)
>
> Who knows the right and easy script?
>
> This is what the script shows now:
> 
> 
>  href="#l" /
>  
>
> Thanks,
> Erik
>


[jQuery] Re: Ajax Upload

2009-07-17 Thread James

You can't rename the file on the user's computer. Only the final saved
file on the server-side. You'd have to change the script to change the
alert text making it seem like that file [username]_15987456.jpg was
uploaded.

On Jul 17, 3:45 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> I an using the Valums ajax upload script, working fine...
>
> But i have a question about using jquery to change the file name.
>
> A user might be uploading 7.jpg and on the server I rename the file to match
> the user and unique id so 7.jpg turns into something like
> [username]_15987456.jpg
>
> When the file is uploaded it says 7.jpg uploaded but how can i either rename
> the file before uploading it and not renameit on the server or get the
> [username]_15987456.jpg after the upload?
>
> Thanks,
>
> Dave


[jQuery] Ajax Upload

2009-07-17 Thread Dave Maharaj :: WidePixels.com
I an using the Valums ajax upload script, working fine...
 
But i have a question about using jquery to change the file name.
 
A user might be uploading 7.jpg and on the server I rename the file to match
the user and unique id so 7.jpg turns into something like
[username]_15987456.jpg
 
When the file is uploaded it says 7.jpg uploaded but how can i either rename
the file before uploading it and not renameit on the server or get the
[username]_15987456.jpg after the upload?
 
Thanks,
 
Dave 


[jQuery] Re: (Validate) Validation is only occuring the first time "Submit" is clicked

2009-07-17 Thread bcbounders

I'm not sure if this is the BEST way (or even vaguely the correct way)
to fix this, but I seem to have solved my own problem.

I changed the jQuery/Validate code to the following:

$(document).ready(function() {
// validate contact form on keyup and submit
$("#contactForm").validate({
rules: {
contactName: {
required: true,
minlength: 2
},
contactEmail: {
required: true,
email: true
},
message: {
required: true,
minlength: 2
}
},
messages: {
contactName: "Please enter your name (2 character 
minimum)",
contactEmail: "Please enter a valid email address",
message: "Please enter your message (2 character 
minimum)"
},
errorPlacement: function(error, element) {
element.siblings("label").children("span.error").html(" 
 " +
error.text());
},
success: function(label){
label.html("");
},
submitHandler: function(form) {
form.submit();
}
});

$("#reset").click(function(){
$("span.error").html("");
});
});

Basically, I changed the "success" function (I re-read the options/
example for this and saw a potential error) and added in the
"submitHandler" function (which I think is redundant, since it SHOULD,
theoretically, trigger the form.submit by itself, but I figured it
didn't hurt to be explicit).

The additional "#reset" click function was needed to remove the error
labels when the user clicks the "Reset" button on the form, as they
were staying put before.

Sorry for the post, followed by the quick retraction, but maybe this
will help someone else.  OR... maybe someone can point out a better
way.  :D

Thanks.

 - John


On Jul 17, 3:34 pm, bcbounders  wrote:
> I've got weird behavior on the contact form at this 
> address:http://tinyurl.com/myy8gp'
>
> The initial validation works (i.e. leave all fields blank and click
> submit).  If you then enter anything valid into any one of the
> required fields and click submit again, the jQuery validation doesn't
> seem to occur again (or, if it does, it passes everything even though
> other required fields are not valid) and it passes everything to the
> PHP file for processing.
>
> Here is the code for the form:
> 
>         
>                 
>                         Name:  class="reqField">* class="error reqField">
>                          name="contactName" /
>
>                 
>                 
>                         Email:  class="reqField">* span>
>                          name="contactEmail" />
>                 
>                 
>                         Phone:
>                          name="contactPhone"
> id="contactPhone" />
>                 
>                 
>                         Company:
>                          id="contactCompany" />
>                 
>                 
>                         Subject:
>                          name="subject"
> id="subject" />
>                 
>                         Message:  class="reqField">* class="error reqField">
>                          name="message"
> id="message">
>                 
>                 
>                          value="Submit" />  
> value="Reset" />
>                         *Required 
> Fields
>                 
>         
> 
>
> And here is the jQuery code for the Validation Plugin:
>
> $(document).ready(function() {
>         // validate contact form on keyup and submit
>         $("#contactForm").validate({
>                 rules: {
>                         contactName: {
>                                 required: true,
>                                 minlength: 2
>                         },
>                         contactEmail: {
>                                 required: true,
>                                 email: true
>                         },
>                         message: {
>                                 required: true,
>                                 minlength: 2
>                         }
>                 },
>                 messages: {
>                         contactName: "Please enter your name (2 character 
> minimum)",
>                         contactEmail: "Please enter a valid email address",
>                         message: "Please enter your message (2 character 
> minimum)"
>                 },
>                 errorPlacement: function(error, element) {
>                         
> element.siblings("label").children("span.error").

[jQuery] Re: event.preventDefault(); not working in IE

2009-07-17 Thread Theodore Ni
It's been common practice when coding for Firefox to do this. That it isn't
the same in Chrome I hadn't noticed, see:


Test


var event = 'test';

alert(window.event);
window.onload = function() {
  alert(window.event);
  setTimeout(function() {
alert(window.event);
  }, 1000);
};







Ted


On Fri, Jul 17, 2009 at 5:30 PM, robotwink  wrote:

>
> Thanks, but why it's working fine in Chrome without the function
> parameter?
>
> On Jul 17, 5:09 pm, James  wrote:
> > The event object doesn't exist in your callback function, you have to
> > put it in the function parameter list:
> >
> > $("#send").click(function (event){  // <- over here
> >
> > event.preventDefault();
> >
> > });
> >
> > On Jul 17, 10:28 am, robotwink  wrote:
> >
> >
> >
> > > Hi,
> >
> > > Here's how it looks:
> >
> > > 
> > > 
> > > 
> >
> > > On Jul 17, 4:25 pm, James  wrote:
> >
> > > > Without seeing the context of the rest of your code, it's difficult
> to
> > > > help. Are you sure 'event' is set to the correct event object?
> >
> > > > On Jul 17, 10:18 am, robotwink  wrote:
> >
> > > > > Hello,
> >
> > > > > I'm using IE8 and when I pass: event.preventDefault(); I get an
> error
> > > > > message:
> >
> > > > > Webpage error details
> >
> > > > > User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0;
> Trident/
> > > > > 4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR
> > > > > 3.0.30729; .NET CLR 3.5.30729)
> > > > > Timestamp: Fri, 17 Jul 2009 20:07:41 UTC
> >
> > > > > Message: Object doesn't support this property or method
> > > > > Line: 256
> > > > > Char: 3
> >
> > > > > Please help. Thanks.
>


[jQuery] Re: My new website AllJobsXChange.com developed with Jquery

2009-07-17 Thread son

Thank you Rob.

I can't remember what make me use the XHTML doctype, I thought I had
some problem with running some jquery stuff, but not sure.

what is the ideal doctype the will work well with JQuery?

I need to review my tags. The validation site is really helpful.

Son


On Jul 17, 5:53 am, RobG  wrote:
> On Jul 17, 11:19 am, son  wrote:
>
> > Hi. My website,www.alljobsxchange.comwasdeveloped with the use of
> > JQuery.
>
> Yet another site using an XHTML doctype served as text/html, even to
> browsers that understand XML.  The W3C validator found 62 errors:
>
> http://validator.w3.org/check?uri=http%3A%2F%2Fwww.alljobsxchange.com...
>
>
>
> Not good for a site with a few lines of text and a single input
> element. Why is javascript and browser sniffing used at all?
>
> --
> Rob
> .


[jQuery] Re: My new website AllJobsXChange.com developed with Jquery

2009-07-17 Thread son

Thank you Tom.
I need to review my tags. I was in a hurry to get this notice page
out.

Son

On Jul 17, 4:31 am, Theodore Ni  wrote:
> Sounds great that your site is getting ready to launch. The notice page,
> from what I see, seems to work fine at least :-). Just as a point of
> professional interest, with your doctype the  tags should have their
> own ending forward slashes. You seem to know this, so maybe your CMS is
> preventing it?
> Ted
>
>
>
> On Thu, Jul 16, 2009 at 9:19 PM, son  wrote:
>
> > Hi. My website,www.alljobsxchange.comwas developed with the use of
> > JQuery.
> > I really appreciate all the people that put their time and effort to
> > make JQuery the way it is now.
>
> > The site will go live in July 31, 2009.
>
> > This site will allow job providers, job seekers, service providers and
> > service seekers to manage their job and service posting needs. I am
> > providing this to everyone absolutely free.
>
> > Hopefully, you can take a look when it goes live on July 31. Go to
> >www.alljobsxchange.comand enter your email address, so you will be
> > notified when the site is ready.
>
> > Anybody who would like a preview of the site, can contact me at
> > webmas...@alljobsxchange.com.
>
> > The preview site should be ready in a day or 2.
>
> > Thanks,
>
> > Son- Hide quoted text -
>
> - Show quoted text -


[jQuery] (Validate) Validation is only occuring the first time "Submit" is clicked

2009-07-17 Thread bcbounders

I've got weird behavior on the contact form at this address:
http://tinyurl.com/myy8gp'

The initial validation works (i.e. leave all fields blank and click
submit).  If you then enter anything valid into any one of the
required fields and click submit again, the jQuery validation doesn't
seem to occur again (or, if it does, it passes everything even though
other required fields are not valid) and it passes everything to the
PHP file for processing.

Here is the code for the form:



Name: *



Email: *



Phone:



Company:



Subject:


Message: *



  
*Required Fields




And here is the jQuery code for the Validation Plugin:

$(document).ready(function() {
// validate contact form on keyup and submit
$("#contactForm").validate({
rules: {
contactName: {
required: true,
minlength: 2
},
contactEmail: {
required: true,
email: true
},
message: {
required: true,
minlength: 2
}
},
messages: {
contactName: "Please enter your name (2 character 
minimum)",
contactEmail: "Please enter a valid email address",
message: "Please enter your message (2 character 
minimum)"
},
errorPlacement: function(error, element) {
element.siblings("label").children("span.error").html(" 
 " +
error.text());
},
success: function(error, element){

element.siblings("label").children("span.error").text("");
}
});
});

I appreciate any insight into what could be going wrong, as I'm
stumped.

Thanks a lot!

  - John


[jQuery] Re: Tooltip for hotspot (area shape)

2009-07-17 Thread e...@uitenbogaard.nl

I tried, but din'nt funcyion. All new for me. Can you tell me.

On 17 jul, 21:44, Charlie  wrote:
> have used it on area tags, no differennt than any other tag,, follow standard 
> instructionse...@uitenbogaard.nlwrote:Hi, I'am looking for a solution to use 
> dynamic tooltips when mouse comes over a hotspot (several hotspots in an 
> image). I like the tooltip on the homepage of this forum 
> (http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/). - tooltip 
> sticks to pointer - appears directly - fonts, colors etc. can be manipulated 
> Is there a proper solution? This is what the script shows now:  name="Map" id="Map">  href="#l" />  href="#l" / href="#" / (I need separate tooltips on every area shape) Thanks, 
> Erik


[jQuery] Re: event.preventDefault(); not working in IE

2009-07-17 Thread robotwink

Thanks, but why it's working fine in Chrome without the function
parameter?

On Jul 17, 5:09 pm, James  wrote:
> The event object doesn't exist in your callback function, you have to
> put it in the function parameter list:
>
>         $("#send").click(function (event){  // <- over here
>
>                 event.preventDefault();
>
>         });
>
> On Jul 17, 10:28 am, robotwink  wrote:
>
>
>
> > Hi,
>
> > Here's how it looks:
>
> > 
> > 
> > 
>
> > On Jul 17, 4:25 pm, James  wrote:
>
> > > Without seeing the context of the rest of your code, it's difficult to
> > > help. Are you sure 'event' is set to the correct event object?
>
> > > On Jul 17, 10:18 am, robotwink  wrote:
>
> > > > Hello,
>
> > > > I'm using IE8 and when I pass: event.preventDefault(); I get an error
> > > > message:
>
> > > > Webpage error details
>
> > > > User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/
> > > > 4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR
> > > > 3.0.30729; .NET CLR 3.5.30729)
> > > > Timestamp: Fri, 17 Jul 2009 20:07:41 UTC
>
> > > > Message: Object doesn't support this property or method
> > > > Line: 256
> > > > Char: 3
>
> > > > Please help. Thanks.


[jQuery] Re: event.preventDefault(); not working in IE

2009-07-17 Thread James

The event object doesn't exist in your callback function, you have to
put it in the function parameter list:

$("#send").click(function (event){  // <- over here

event.preventDefault();

});

On Jul 17, 10:28 am, robotwink  wrote:
> Hi,
>
> Here's how it looks:
>
> 
> 
> 
>
> On Jul 17, 4:25 pm, James  wrote:
>
> > Without seeing the context of the rest of your code, it's difficult to
> > help. Are you sure 'event' is set to the correct event object?
>
> > On Jul 17, 10:18 am, robotwink  wrote:
>
> > > Hello,
>
> > > I'm using IE8 and when I pass: event.preventDefault(); I get an error
> > > message:
>
> > > Webpage error details
>
> > > User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/
> > > 4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR
> > > 3.0.30729; .NET CLR 3.5.30729)
> > > Timestamp: Fri, 17 Jul 2009 20:07:41 UTC
>
> > > Message: Object doesn't support this property or method
> > > Line: 256
> > > Char: 3
>
> > > Please help. Thanks.
>
>


[jQuery] Re: li/img click and window.keydown

2009-07-17 Thread Lideln

Up ! :)


On 16 juil, 22:32, Lideln  wrote:
> up
>
> On 16 juil, 08:10, Lideln  wrote:
>
> > up !
>
> > (wow, this forum gets 10 new posts per hour)
>
> > On 15 juil, 21:52, Lideln  wrote:
>
> > > Hi everybody !
>
> > > I have a jqModal window, and I would like to close it using the ESC
> > > key. For that purpose, I assign my modal a keydown() event, and if
> > > keyCode == 27, I close the modal.
>
> > > It works fine, except when I click on another element in the modal
> > > first I have to press 2 times ESC : the first time removes the
> > > focus from the element, the second time goes through my listener and
> > > closes the modal.
>
> > > In my modal , I have an ul/li list, each li containing an img (for the
> > > purpose of an image gallery).
>
> > > When I click on an image (or li ?), I have to press twice ESC to close
> > > the modal. I tried to add a $(this).blur() in the li click() event,
> > > and also I tried to put that in the img click event, but without
> > > success...
>
> > > Does somebody know why it is doing that, and how to fix it, please ?
>
> > > Thanks a lot !


[jQuery] Re: File uploader with preview like box.net, etc.?

2009-07-17 Thread Charlie





http://www.tinywebgallery.com/en/tfu/web_demo1.php

remote file view, rename files, image view and uploader(Flash)


donb wrote:

  What was I smoking when I wrote that?  No, the site that had the
'nice' uploader was:

http://www.element-it.com/Examples/MultiPowUpload/ThumbnailsViewerHTMLinterface.html

"Nice" in that it let's me select several files at once and has a
scrolling region previewing all the pending uploads.  But it looks
hidious.  And being a commercial product, advancement of it is
destined to be a long, slow endeavor.

On Jul 16, 9:34 pm, donb  wrote:
  
  
Seems the preview aspect is being a real bugger - I don't see anyone
successfully doing it with any of the current crop of jquery
uploaders.

There are a number of sites doing it, such as box.net which I think is
quite a nice one.

I found some info on the matter here:

http://blog.flexexamples.com/2008/08/25/previewing-an-image-before-up...

I have Flash 8 and found it nigh onto impossible to do anything
useful.  I wrestled with it for a time and finally quit, as it just
seemed so retarded AND it liked to randomly crash before I saved my
work.

So I'm very resistant to getting a Flash 10 upgrade.  I'm hoping
there's someone smarter than me tackling this monster.

Is that the case?  Anyone?

tnx,

Don

  
  
  






[jQuery] Re: Cross Slide Pause on Mouseover

2009-07-17 Thread Charlie





lots of image viewres/slideshow plugins provide option to pause on
hover. SOme are very light and don;t have a lot of options.

If yours doesn't provide option easiest would be swap it with one that
does, such as Cycle. Trying to step into the plugin code to set and
clear time outs likely take you a lot longer than swapping plugins.
Cycle has a great API also, change over won't take long

agaldesign wrote:

  Hello,

How do I make the images to pause on mouseover?

Here is and example of my script: http://marshallsouthern.bigrigmedia.com/story.asp

Thank You!!!

  






[jQuery] Re: clone() + Sortable and Draggable

2009-07-17 Thread Jérôme GRAS
Ok, I fixed the first id bug.
The new version is online.

Unfortunately, the main problem is still present.
I tried a lot of things unsuccessfully...

Please take a look :-)

On Fri, Jul 17, 2009 at 15:07, Mean Mike  wrote:

>
> I found a least one major problem here
>
> $("#champs").append($("#champs_caches").clone(true).removeClass("ui-
> helper-hidden"));
>
>  your cloning div with id "#champs_caches" thereby creating another
> div with the same id
>
> there may be more problems than that but get that fixed then lets go
> from there
>
> Mean Mike
>
> On Jul 17, 2:58 am, rejome  wrote:
> > Hello everyone !
> >
> > I am facing a strange problem here :
> http://rejome.homeip.net:8080/prototype.html
> >
> > When I clone a list that is part of a Sortable, the Draggable objects
> > are not bound to the cloned list, only the original one.
> >
> > Do you have a solution or a hint for me please ?
> >
> > Thanks in advance.
> > Réjôme.
> >
>


[jQuery] Re: event.preventDefault(); not working in IE

2009-07-17 Thread robotwink

Hi,

Here's how it looks:





On Jul 17, 4:25 pm, James  wrote:
> Without seeing the context of the rest of your code, it's difficult to
> help. Are you sure 'event' is set to the correct event object?
>
> On Jul 17, 10:18 am, robotwink  wrote:
>
>
>
> > Hello,
>
> > I'm using IE8 and when I pass: event.preventDefault(); I get an error
> > message:
>
> > Webpage error details
>
> > User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/
> > 4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR
> > 3.0.30729; .NET CLR 3.5.30729)
> > Timestamp: Fri, 17 Jul 2009 20:07:41 UTC
>
> > Message: Object doesn't support this property or method
> > Line: 256
> > Char: 3
>
> > Please help. Thanks.


[jQuery] Re: I dont understand why this doesnt work.

2009-07-17 Thread Mike

Thanks for the response.  I had a complete brain fart on the xss
policy.

On Jul 17, 3:12 pm, Michael Lawson  wrote:
> That shouldn't work at all.  Unless your page is sitting athttp://twitter.com
>
> http://en.wikipedia.org/wiki/Same_origin_policy
>
> cheers
>
> Michael Lawson
> Development Lead, Global Solutions, ibm.com
> Phone:  1-276-206-8393
> E-mail:  mjlaw...@us.ibm.com
>
> 'Whether one believes in a religion or not,
> and whether one believes in rebirth or not,
> there isn't anyone who doesn't appreciate kindness and compassion..'
>
>   From:       Mike                                         
>                                                 
>
>   To:         "jQuery (English)"                  
>                                                  
>
>   Date:       07/17/2009 04:09 PM                                             
>                                                  
>
>   Subject:    [jQuery] I dont understand why this doesnt work.                
>                                                 
>
> Its simple:
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml"; >
> 
>     
>
>     
>
>     
>  $(document).ready(function() {
>             $.get("http://twitter.com/statuses/user_timeline/
> 19092829.rss");
>         });
>  
> 
> 
>
> 
> 
>
> In IE and Opera this works perfectly, but in FF 3.5, Chrome, and
> Safari I get a 400 Bad Request.  Looking at the request using Fiddler2
> and FireBug, something is replacing GET with OPTIONS.  But in IE and
> Opera, it is still showing up as GET.  I dont get it
>
>  graycol.gif
> < 1KViewDownload
>
>  ecblank.gif
> < 1KViewDownload


[jQuery] Re: event.preventDefault(); not working in IE

2009-07-17 Thread James

Without seeing the context of the rest of your code, it's difficult to
help. Are you sure 'event' is set to the correct event object?

On Jul 17, 10:18 am, robotwink  wrote:
> Hello,
>
> I'm using IE8 and when I pass: event.preventDefault(); I get an error
> message:
>
> Webpage error details
>
> User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/
> 4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR
> 3.0.30729; .NET CLR 3.5.30729)
> Timestamp: Fri, 17 Jul 2009 20:07:41 UTC
>
> Message: Object doesn't support this property or method
> Line: 256
> Char: 3
>
> Please help. Thanks.


[jQuery] Re: Newbie Datepicker Question

2009-07-17 Thread James

That was just an example.
You should try to make it the same then. Use your server-side script
that gets the date from the database to format the date before you
output it so it's the same as what datepicker uses (or whatever you
set it).

On Jul 17, 9:50 am, sankofa  wrote:
> The initial value is not the same.  It is coming from the database as
> a timestamp with the time & date.  There is no leading zero before the
> month.


[jQuery] Cross Slide Pause on Mouseover

2009-07-17 Thread agaldesign

Hello,

How do I make the images to pause on mouseover?

Here is and example of my script: 
http://marshallsouthern.bigrigmedia.com/story.asp

Thank You!!!


[jQuery] Re: I dont understand why this doesnt work.

2009-07-17 Thread James

Maybe you should try using Twitter's API (with JSON) along with the
jQuery's $.getJSON().

On Jul 17, 10:09 am, Mike  wrote:
> Its simple:
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml"; >
> 
>     
>
>     
>
>     
>  $(document).ready(function() {
>             $.get("http://twitter.com/statuses/user_timeline/
> 19092829.rss");
>         });
>  
> 
> 
>
> 
> 
>
> In IE and Opera this works perfectly, but in FF 3.5, Chrome, and
> Safari I get a 400 Bad Request.  Looking at the request using Fiddler2
> and FireBug, something is replacing GET with OPTIONS.  But in IE and
> Opera, it is still showing up as GET.  I dont get it


[jQuery] event.preventDefault(); not working in IE

2009-07-17 Thread robotwink

Hello,

I'm using IE8 and when I pass: event.preventDefault(); I get an error
message:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/
4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR
3.0.30729; .NET CLR 3.5.30729)
Timestamp: Fri, 17 Jul 2009 20:07:41 UTC


Message: Object doesn't support this property or method
Line: 256
Char: 3

Please help. Thanks.


[jQuery] Re: I dont understand why this doesnt work.

2009-07-17 Thread Michael Lawson
That shouldn't work at all.  Unless your page is sitting at
http://twitter.com

http://en.wikipedia.org/wiki/Same_origin_policy


cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'



   
  From:   Mike   
   

   
  To: "jQuery (English)"
   

   
  Date:   07/17/2009 04:09 PM   
   

   
  Subject:[jQuery] I dont understand why this doesnt work.  
   

   






Its simple:

http://www.w3.org/1999/xhtml"; >







 $(document).ready(function() {
$.get("http://twitter.com/statuses/user_timeline/
19092829.rss");
});
 







In IE and Opera this works perfectly, but in FF 3.5, Chrome, and
Safari I get a 400 Bad Request.  Looking at the request using Fiddler2
and FireBug, something is replacing GET with OPTIONS.  But in IE and
Opera, it is still showing up as GET.  I dont get it

<><>

[jQuery] I dont understand why this doesnt work.

2009-07-17 Thread Mike

Its simple:

http://www.w3.org/1999/xhtml"; >







 $(document).ready(function() {
$.get("http://twitter.com/statuses/user_timeline/
19092829.rss");
});
 







In IE and Opera this works perfectly, but in FF 3.5, Chrome, and
Safari I get a 400 Bad Request.  Looking at the request using Fiddler2
and FireBug, something is replacing GET with OPTIONS.  But in IE and
Opera, it is still showing up as GET.  I dont get it


[jQuery] Re: Injecting tags to specific location.

2009-07-17 Thread Charlie





try this:

$("#maincontent, .left , .right").prepend('');
$("#maincontent, .left ,
.right").append('');




pennfoli0 wrote:

  Hi,

My CMS won't let me customize their HTML structure they didn't give me
access to their templating system. But they'd let me access their Head
section were I could add custom _javascript_ and CSS.

Example this would be their template structure:




Maincontent  

Left Contents  

Right Contents  






This what I want to achieve:




  
 
 


 Maincontent

 
  
  
  

  
 
 


 Left Contents

 
  
  
  

  
 
 


 Right Contents

 
  
  
  






The reason why the injections was structured like that is, I want the
regular divs to be rounded. the Inject1, Inject2, Inject3 would be
style in my external CSS. To all JQuery experts there I really need
help... I think it would also be great if it was like a class that i
can just be apply it to specific ids or class.

Thanks!

  






[jQuery] Validate Plugin - using the submitHandler

2009-07-17 Thread pocket

I need to display a promotional message when the user clicks submit if
they meet certain criteria about their postcode. I have heard that you
should use the submitHandler but being completely new to JavaScript
and even newer to JQuery I am a little stuck on how I should write
this. I thought it would be something like this but it obviously
doesn't work.

submitHandler: function(form) {
var special = 
/^[T]{1}[A]{1}([1-13|17|19|25]){2}/.test(value);
if (special);
alert('You have been entered into a competition to win 
a special
prize');
form.submit();
}, // end of submitHandler

I basically need this message to display when they click submit and
then they confirm and the form goes to the server.

This is the code I have so far for the validation:

 $(document).ready(function(){
 $("#orderForm").validate({
onfocusout: function(element) {
this.element(element);
},
rules: {
firstName: {
required: true,
},
surname: {
required: true,
},
phoneNumber: {
required: true,
},
streetName: {
required: true,
},
city: {
required: true,
},
postalCode: {
required: true,
shipPostalCode: true,
},
billEmailAddress: {
required: true,
},
billPhoneNumber: {
required: true,
},
promoCardNumber: {
required: true,
fidelityCardNumber: true,
},
billCardNumber: {
required: true,
},
billCardType: {
required: true,
},
}, //end of rules
}); // end of validate
}); // end of function

$.validator.addMethod('postalCode', function (value) {
return /^[A-Z]{2}\d{1,2}\s\d{1,2}[A-Z]{2}$/.test(value);
}, 'Please enter a valid postcode');
$.validator.addMethod('promoCardNumber', function (value) {
return 
/^[A-Z]{1}([A-Z]|\d){4}\s?([A-Z]|\d){5}\s?([A-Z]|\d){3}\d{1}
(\!|\&|\@|\?){1}$/.test(value);
}, 'Please enter a valid card number');

This is my html code:

   
  

  
Shipping and Billing Information
  
   


  First Name
  


  Surname
  


  Contact Telephone Number
  


  Street Name
  


  City
  


  Post Code
  


  Email address
  


  Contact Telephone Number
  


  Promotional Card
  


  Credit Card Number
  


  Credit Card Type
  

  Choose your card...


  Visa


  Mastercard

  


  Instructions
  
  
Enter your requirements here or comments.



  
  

  



[jQuery] Re: Newbie Datepicker Question

2009-07-17 Thread sankofa

The initial value is not the same.  It is coming from the database as
a timestamp with the time & date.  There is no leading zero before the
month.


[jQuery] Re: Injecting tags to specific location.

2009-07-17 Thread James

I think something as simple as this should work:

$("#maincontent, #left, #right").each(function() {
var content = $(this).html();
$(this).html(''+content+'');
});

Might get a bit more complicated if there are other javascript that
acts on the content. It might break some existing css also if they
bound to the current structure.

On Jul 17, 9:38 am, pennfoli0  wrote:
> Hi,
>
> My CMS won't let me customize their HTML structure they didn't give me
> access to their templating system. But they'd let me access their Head
> section were I could add custom Javascript and CSS.
>
> Example this would be their template structure:
>
> 
> 
>
>         Maincontent  
>
>         Left Contents  
>
>         Right Contents  
>
> 
> 
>
> This what I want to achieve:
>
> 
> 
>
>       
>          
>              
>                 
>
>              Maincontent
>
>                  
>               
>           
>       
>
>       
>          
>              
>                 
>
>              Left Contents
>
>                  
>               
>           
>       
>
>       
>          
>              
>                 
>
>              Right Contents
>
>                  
>               
>           
>       
>
> 
> 
>
> The reason why the injections was structured like that is, I want the
> regular divs to be rounded. the Inject1, Inject2, Inject3 would be
> style in my external CSS. To all JQuery experts there I really need
> help... I think it would also be great if it was like a class that i
> can just be apply it to specific ids or class.
>
> Thanks!


[jQuery] Re: Tooltip for hotspot (area shape)

2009-07-17 Thread Charlie





have used it on area tags, no differennt than any other tag,, follow
standard instructions

e...@uitenbogaard.nl wrote:

  Hi,
I'am looking for a solution to use dynamic tooltips when mouse comes
over a hotspot (several hotspots in an image).
I like the tooltip on the homepage of this forum (http://
bassistance.de/jquery-plugins/jquery-plugin-tooltip/).
- tooltip sticks to pointer
- appears directly
- fonts, colors etc. can be manipulated

Is there a proper solution?

This is what the script shows now:



  
  

(I need separate tooltips on every area shape)

Thanks,
Erik

  






[jQuery] Injecting tags to specific location.

2009-07-17 Thread pennfoli0

Hi,

My CMS won't let me customize their HTML structure they didn't give me
access to their templating system. But they'd let me access their Head
section were I could add custom Javascript and CSS.

Example this would be their template structure:




Maincontent  

Left Contents  

Right Contents  






This what I want to achieve:




  
 
 


 Maincontent

 
  
  
  

  
 
 


 Left Contents

 
  
  
  

  
 
 


 Right Contents

 
  
  
  






The reason why the injections was structured like that is, I want the
regular divs to be rounded. the Inject1, Inject2, Inject3 would be
style in my external CSS. To all JQuery experts there I really need
help... I think it would also be great if it was like a class that i
can just be apply it to specific ids or class.

Thanks!


[jQuery] Re: data: $("#contact_form").serialize(),

2009-07-17 Thread robotwink

Thank you so much, that solved the problem.

On Jul 17, 3:04 pm, Theodore Ni  wrote:
> It is because you get rid of the form when you replace the message inside
> #form before calling serialize(). Move this line
>     $("#form").html('Please wait...');
>
> below everything else, and serialize() will no longer return empty.
>
> Ted
>
>
>
> On Fri, Jul 17, 2009 at 2:54 PM, robotwink  wrote:
>
> > Hello,
>
> > I tried for hours and no luck. Here's my code:
>
> >http://stikked.com/view/4d9c1242
>
> > I would really appreciate if anyone can tell me why $
> > ("#contact_form").serialize() is always returning empty string.
>
> > On Jul 16, 2:26 pm, James  wrote:
> > > Could you define "not working"?
>
> > > Are there any error messages?
> > > Is $("#contact_form").serialize() not giving the right values?
> > > Is the AJAX request not being sent?
> > > Is there no response coming back from the AJAX request?
>
> > > Try adding an 'error' callback also to see if it gets called.
>
> > > On Jul 15, 6:24 pm,robotwink wrote:
>
> > > > Hi guys,
>
> > > > I need to send the whole form to the server for processing. I have
> > > > this now, which is not working:
>
> > > > $.ajax({
> > > >                                 type: "POST",
> > > >                                 url: "file.php",
> > > >                                 data: $("#contact_form").serialize(),
> > > >                                 success: function(data){
> > > >                                         alert('ok');
> > > >                                 }
> > > >                         });
>
> > > > Please let me what's wrong and how to fix it. Thanks.


[jQuery] Re: non-ajax Post?

2009-07-17 Thread James

What happens if you use $.ajax and set option async:false? It might
stall the page a little, but try to see if it works.

On Jul 17, 9:17 am, Theodore Ni  wrote:
> Your best option is to log on the server-side page the form submits to.
> Barring that, you can always submit the form on a callback from your $.get()
> call.
> Ted
>
> On Wed, Jul 15, 2009 at 4:26 PM, IMStarboard wrote:
>
>
>
> > There is a form that performs a post on our site that I need to insert
> > an "onclick" call to perform some logging using $.get() , but the call
> > is never executed because the form posts before the call can be
> > executed.  I believe this because if I insert an alert("test") after
> > that call, it works, otherwise it doesn't.
>
> > I thought to pull the submission out into a separate function that is
> > called from "onclick=" that would execute my new $.get and then do the
> > form post with $.post, and finish with exit(false) so the form html
> > doesn't post again, but the $.post is only an ajax call and I also
> > need it to redirect the browser to a new document location.
>
> > Any thoughts?
>
> > Thanks!
>
>


[jQuery] Re: Bug jQuery 1.3.2 & FF3.5 - $("input[name='']")

2009-07-17 Thread MorningZ

i wonder if this would work

$("input, textarea").not("[name]").each()

.

On Jul 17, 9:58 am, false  wrote:
> This code used to work before i upgraded to FF3.5. Is there any other
> way to achive the same thing?
>
>  $("input[name=''],textarea[name='']").each(function(i) {
>
>     this.name = this.id;
>
> });


[jQuery] Re: non-ajax Post?

2009-07-17 Thread Theodore Ni
Your best option is to log on the server-side page the form submits to.
Barring that, you can always submit the form on a callback from your $.get()
call.
Ted


On Wed, Jul 15, 2009 at 4:26 PM, IMStarboard wrote:

>
> There is a form that performs a post on our site that I need to insert
> an "onclick" call to perform some logging using $.get() , but the call
> is never executed because the form posts before the call can be
> executed.  I believe this because if I insert an alert("test") after
> that call, it works, otherwise it doesn't.
>
> I thought to pull the submission out into a separate function that is
> called from "onclick=" that would execute my new $.get and then do the
> form post with $.post, and finish with exit(false) so the form html
> doesn't post again, but the $.post is only an ajax call and I also
> need it to redirect the browser to a new document location.
>
> Any thoughts?
>
> Thanks!
>


[jQuery] Re: Newbie Datepicker Question

2009-07-17 Thread James

Sorry, that should've been:
(e.g. 4/03/2010, and not 04/03/2010)

On Jul 17, 9:16 am, James  wrote:
> Is the initial value in the textbox in the same format the datepicker
> would put into the textbox if a date was selected?
> (e.g. 4/03/2010, and not 4/03/2010)
>
> On Jul 17, 8:30 am, sankofa  wrote:
>
> > I have succesfully applied the datepicker to a blank textbox.
>
> > However, when I apply the datepicker to a textbox with the initial
> > value dynamically set to display a value from a database, the date
> > picker genertes an error when anything on it is selected.
>
> > The datepicker will display when the trigger icon is selected but you
> > cannot select anything from the date picker without generating the
> > following errors:
>
> > When selecting:
>
> > a day: 'undefined' is null or not an object (ui.datepicker.js line
> > 767)
>
> > a month or year: 'input' is null or not an object (ui.datepicker.js
> > line 755)
>
> > a back or forward arrow: 'settings' is null or not an object (u.i
> > datepicker.js line 1137)
>
> > I have looked at these lines in the file, but I have no idea where to
> > begin.
>
>


[jQuery] Re: AJAX load()

2009-07-17 Thread Phil

:D Brilliant, thanks. I have tried this in some form but i couldn't
get it to work.

Thanks :)

On Jul 17, 8:13 pm, James  wrote:
> How about something like this:
>
> 
> 
> 
> 
>         $(document).ready(function(){
>                 $('input.load').click(function(){
>                         $('#Details').load('episodes.html .'+this.id);
>                 });
>         });
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> On Jul 17, 8:51 am, Phil  wrote:
>
> > Here i have a problem: I am uing the AJAX load() and use it like this
>
> > 
> > 
> > 
> > 
> >         $(document).ready(function(){
> >                 $('#load1').click(function(){
> >                         $('#Details').load('episodes.html .one');
> >                 });
> >                 $('#load2').click(function(){
> >                         $('#Details').load('episodes.html .two');
> >                 });
> >                 $('#load3').click(function(){
> >                         $('#Details').load('episodes.html .three');
> >                 });
> >         });
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
>
> > See that clicking the diffrent buttons will load diffrent content. I
> > plan to have upwards of 50 links and was wondering if there was a way
> > i could have one function to load the diffrent content. i have tried
> > various methods non of which have worked so i will leave this open.
>
> > thanks in advance Phil.


[jQuery] Re: Newbie Datepicker Question

2009-07-17 Thread James

Is the initial value in the textbox in the same format the datepicker
would put into the textbox if a date was selected?
(e.g. 4/03/2010, and not 4/03/2010)

On Jul 17, 8:30 am, sankofa  wrote:
> I have succesfully applied the datepicker to a blank textbox.
>
> However, when I apply the datepicker to a textbox with the initial
> value dynamically set to display a value from a database, the date
> picker genertes an error when anything on it is selected.
>
> The datepicker will display when the trigger icon is selected but you
> cannot select anything from the date picker without generating the
> following errors:
>
> When selecting:
>
> a day: 'undefined' is null or not an object (ui.datepicker.js line
> 767)
>
> a month or year: 'input' is null or not an object (ui.datepicker.js
> line 755)
>
> a back or forward arrow: 'settings' is null or not an object (u.i
> datepicker.js line 1137)
>
> I have looked at these lines in the file, but I have no idea where to
> begin.


[jQuery] Re: AJAX load()

2009-07-17 Thread James

How about something like this:





$(document).ready(function(){
$('input.load').click(function(){
$('#Details').load('episodes.html .'+this.id);
});
});










On Jul 17, 8:51 am, Phil  wrote:
> Here i have a problem: I am uing the AJAX load() and use it like this
>
> 
> 
> 
> 
>         $(document).ready(function(){
>                 $('#load1').click(function(){
>                         $('#Details').load('episodes.html .one');
>                 });
>                 $('#load2').click(function(){
>                         $('#Details').load('episodes.html .two');
>                 });
>                 $('#load3').click(function(){
>                         $('#Details').load('episodes.html .three');
>                 });
>         });
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> See that clicking the diffrent buttons will load diffrent content. I
> plan to have upwards of 50 links and was wondering if there was a way
> i could have one function to load the diffrent content. i have tried
> various methods non of which have worked so i will leave this open.
>
> thanks in advance Phil.


[jQuery] Re: Slideup/down Multiple Divs

2009-07-17 Thread danny.copel...@gmail.com

Ok well - hope it all worked out for you!

:|


On Jul 15, 4:09 pm, "danny.copel...@gmail.com"
 wrote:
> var toggleCheckBox = function(){
>
>         if ($(this).find('.multCheck:checked').val() == 'on') {
>
>                 $(this).find(".addURLSArea").slideDown();
>
>         } else {
>
>                 $(this).find(".addURLSArea").slideUp();
>
>         }
>
> };
>
> $('.divsClassNameGoesHere').click(function(){ toggleCheckBox(); });
>
> does that help?
>
> dan
>
> On Jul 15, 12:22 pm, Nathan Chapman  wrote:
>
>
>
> >  $("#addURLSArea").hide();
>
> >     $('.jqTransformCheckbox').click(function(){
> >         if ($('#multCheck:checked').val() == 'on') {
> >             $("#addURLSArea").slideDown();
> >         } else {
> >             $("#addURLSArea").slideUp();
> >         }
> >     });
>
> > I want to use this 4 times on a form. How do I change this so I can
> > have it target 4 different divs?


[jQuery] [autocomplete] mustmatch problem

2009-07-17 Thread rekna

I'm using jquery autocomplete 1.0.2. The autocomplete retrieves data
from the server and the option mustmatch is set to true.

My data on the server has a code field and a description, and I'm
returning
+" "+|
an example of data returned by the server would be:
FIN Finance|2
PER Personel7

This work fine except when the code field contains numeric data, eg.
010 Finance|2
020 Personel7

In this case, when an element is selected, the textbox is cleared on
selection, although I have a valid selection.
The result event however is triggered, so this indicates I have a
valid selection. The result event is used to set a hidden field to the
 of the selected item.

What do I need to change to make this work?


[jQuery] how to multiple images slideshow with jquery cycle plugin

2009-07-17 Thread AND

Hi ,

i am new to jquery cycle plugin

I would like to make a multiple images slideshow with jquery cycle
plugin

Say I have 12 images and I want to show 3 at a time and cycle through
the 12 in this fashion:
(img1-img2-img3) then (img2-img3-img4) then (img3-img4-img5).
(img11-img12-img1)

auto scroll
on mouseover i need it to be paused and mouseout it should continue..

Thanks in advance
And


[jQuery] Superfish drop down menu pushes down the content below

2009-07-17 Thread GraphicsUNC

Hello! This is a great extension and I have it so that it uses the css
from the template I'm using.

However, the drop down menu pushes down the main content below instead
of hovering over or poping up.

Here is the link - when you scroll over "About Us" or "Services" you
will see what it does. Please help!

http://cobiedelson.com/village/site/


[jQuery] Re: data: $("#contact_form").serialize(),

2009-07-17 Thread Theodore Ni
It is because you get rid of the form when you replace the message inside
#form before calling serialize(). Move this line
$("#form").html('Please wait...');

below everything else, and serialize() will no longer return empty.

Ted


On Fri, Jul 17, 2009 at 2:54 PM, robotwink  wrote:

>
> Hello,
>
> I tried for hours and no luck. Here's my code:
>
> http://stikked.com/view/4d9c1242
>
> I would really appreciate if anyone can tell me why $
> ("#contact_form").serialize() is always returning empty string.
>
> On Jul 16, 2:26 pm, James  wrote:
> > Could you define "not working"?
> >
> > Are there any error messages?
> > Is $("#contact_form").serialize() not giving the right values?
> > Is the AJAX request not being sent?
> > Is there no response coming back from the AJAX request?
> >
> > Try adding an 'error' callback also to see if it gets called.
> >
> > On Jul 15, 6:24 pm,robotwink wrote:
> >
> >
> >
> > > Hi guys,
> >
> > > I need to send the whole form to the server for processing. I have
> > > this now, which is not working:
> >
> > > $.ajax({
> > > type: "POST",
> > > url: "file.php",
> > > data: $("#contact_form").serialize(),
> > > success: function(data){
> > > alert('ok');
> > > }
> > > });
> >
> > > Please let me what's wrong and how to fix it. Thanks.
>


[jQuery] Tooltip for hotspot (area shape)

2009-07-17 Thread e...@uitenbogaard.nl

Hi,
I'am looking for a solution to use dynamic tooltips when mouse comes
over a hotspot (several hotspots in an image).
I like the tooltip on the homepage of this forum (http://
bassistance.de/jquery-plugins/jquery-plugin-tooltip/).
- tooltip sticks to pointer
- appears directly
- fonts, colors etc. can be manipulated

Is there a proper solution?

This is what the script shows now:






(I need separate tooltips on every area shape)

Thanks,
Erik


[jQuery] Looking for tooltip expert

2009-07-17 Thread e...@uitenbogaard.nl

New on jQuery.
I'am looking for dynamic tooltips when mouse comes over a hotspot (I
need tooltips on several hotspots in one image) like the tooltip on
this homepage: http://
bassistance.de/jquery-plugins/jquery-plugin-tooltip/.
(tooltip sticks to pointer - appears directly - fonts, colors, etc.
can be manipulated)

Who knows the right and easy script?

This is what the script shows now:




Thanks,
Erik


[jQuery] Newbie Datepicker Question

2009-07-17 Thread sankofa

I have succesfully applied the datepicker to a blank textbox.

However, when I apply the datepicker to a textbox with the initial
value dynamically set to display a value from a database, the date
picker genertes an error when anything on it is selected.

The datepicker will display when the trigger icon is selected but you
cannot select anything from the date picker without generating the
following errors:

When selecting:

a day: 'undefined' is null or not an object (ui.datepicker.js line
767)

a month or year: 'input' is null or not an object (ui.datepicker.js
line 755)

a back or forward arrow: 'settings' is null or not an object (u.i
datepicker.js line 1137)

I have looked at these lines in the file, but I have no idea where to
begin.


[jQuery] Bug jQuery 1.3.2 & FF3.5 - $("input[name='']")

2009-07-17 Thread false

This code used to work before i upgraded to FF3.5. Is there any other
way to achive the same thing?

 $("input[name=''],textarea[name='']").each(function(i) {

this.name = this.id;

});


[jQuery] Re: flickering issue when using animate() in firefox

2009-07-17 Thread mm

Hi yea, i have come across this four or five times. as a stopgap i
found that reducing the speed of the animation often helps, but it
doesn't completely eliminate the problem and sometimes isn't an
option. i havent found a solution yet though. i will try let you know
if i come across one.

On Jul 8, 12:54 pm, orizen  wrote:
> hi.
> I used jquery for building my portfolio and created a carousel like
> widget.
>
>          http://ajaxian.com/archives/google-chrome-os-web-developers-rule
>
> everything is working fine except for animating in firefox - where the
> animation flickers a bit to the sides.
>
> Has anyone experienced this problem before?
> any possible solution?
> I tried turning off css rules for the carousel with no luck.
>
> Thanks.


[jQuery] Re: Newbie Question....

2009-07-17 Thread Theodore Ni
Yes, your action script can be anything.
Ted


On Fri, Jul 17, 2009 at 2:40 PM, Greg Evans  wrote:

>
> That looks great, and I think it is just what I need. I want to clarify
> however, this shows to comment.php, but something like comment.pl should
> work equally as well correct?
>
>
>
> On Jul 17, 2009, at 11:28 AM, brian wrote:
>
>
>> Do you want the form to submit via AJAX? Have a look at the form plugin.
>>
>> http://malsup.com/jquery/form/
>>
>> On Fri, Jul 17, 2009 at 1:47 PM, raisputin wrote:
>>
>>>
>>> Hello,
>>>
>>> I have just discovered jQuery and it looks cool. I used the jQuery UI
>>> builder at ui.jquery.com to build the UI and it looks and works
>>> great :) Unfortunately I do not know enough about javascript to answer
>>> my own question, so I am deferring to you :)
>>>
>>> I would like to have a tab with a dialog button on it, and when that
>>> dialog comes up there will be a form. This part I can do easily enough
>>> and have already implemented, however, what I need to do after that is
>>> where I am stuck :(
>>>
>>> I want the user to fill out the form, say there are fields like
>>> "Customer Name" "Telephone Number" and "D.O.B." and once that form is
>>> filled out, and the user clicks OK, I want it to do the proper
>>> inserts, etc into my mysql database. This is probably a very easy
>>> question, but I have not found out anything useful so far through
>>> various google searches. I would like to do the bulk of my mysql stuff
>>> via perl/mason. Is there a tutorial anywhere for this or perhaps I
>>> should be using a different technique? I am trying to avoid PHP simply
>>> because I would prefer to not have to learn PHP while I am in the
>>> process of learning the things I need for jQuery, but I can if I need
>>> to.
>>>
>>> Any advice/help/examples would be greatly appreciated.,
>>>
>>> Greg Evans
>>>
>>
>


[jQuery] Re: data: $("#contact_form").serialize(),

2009-07-17 Thread robotwink

Hello,

I tried for hours and no luck. Here's my code:

http://stikked.com/view/4d9c1242

I would really appreciate if anyone can tell me why $
("#contact_form").serialize() is always returning empty string.

On Jul 16, 2:26 pm, James  wrote:
> Could you define "not working"?
>
> Are there any error messages?
> Is $("#contact_form").serialize() not giving the right values?
> Is the AJAX request not being sent?
> Is there no response coming back from the AJAX request?
>
> Try adding an 'error' callback also to see if it gets called.
>
> On Jul 15, 6:24 pm,robotwink wrote:
>
>
>
> > Hi guys,
>
> > I need to send the whole form to the server for processing. I have
> > this now, which is not working:
>
> > $.ajax({
> >                                 type: "POST",
> >                                 url: "file.php",
> >                                 data: $("#contact_form").serialize(),
> >                                 success: function(data){
> >                                         alert('ok');
> >                                 }
> >                         });
>
> > Please let me what's wrong and how to fix it. Thanks.


[jQuery] replaceClass plugin now works on hover or click

2009-07-17 Thread intrinsi

Thanks to feedback about the first version of this plugin, I have
added the ability to trigger it on click as well as hover.

http://plugins.jquery.com/project/replaceClass


Note: There is a switchClass effect in jQueryUI but it currently does
not work in WebKit browers, like Chrome or Safari.


[jQuery] AJAX load()

2009-07-17 Thread Phil

Here i have a problem: I am uing the AJAX load() and use it like this





$(document).ready(function(){
$('#load1').click(function(){
$('#Details').load('episodes.html .one');
});
$('#load2').click(function(){
$('#Details').load('episodes.html .two');
});
$('#load3').click(function(){
$('#Details').load('episodes.html .three');
});
});










See that clicking the diffrent buttons will load diffrent content. I
plan to have upwards of 50 links and was wondering if there was a way
i could have one function to load the diffrent content. i have tried
various methods non of which have worked so i will leave this open.

thanks in advance Phil.


[jQuery] Re: addclass() only works with the first of the matched divs

2009-07-17 Thread Alexandre

that's it.
thanks guys.

On Jul 16, 8:13 pm, "Cesar Sanz"  wrote:
> Id must to be unique.
>
> So, jQuery just find one element with the specified Id,
>
> try to make id uniques
>
> - Original Message -
> From: "Alexandre" 
> To: "jQuery (English)" 
> Sent: Thursday, July 16, 2009 3:40 PM
> Subject: [jQuery]addclass() only works with the first of thematcheddivs
>
> > Hi,
>
> > I'm having an annoying issue withaddClass()
>
> > I'm trying to find all divs with id name '#moldura_slides' and add the
> > class '.horizontal' to each one of them.
> > The problem is that only the firstdivmatchedgets the class. The
> > others are just ignored and don't get it.
>
> > $(document).ready(function()
> > {
> >     $("#moldura_slides").addClass("horizontal");
> > });
>
> > Looked for a solution everywhere and tried other ways of doing this.
> > Nothing worked. Any ideas?
>
> > This is the page:http://www.labbi.com.br/index5.html
>
> > Thanks


[jQuery] Allow iframe from remote domain have javascript access

2009-07-17 Thread Mike521

Hi all, I'm trying something along these lines:

my domain = example.com
external domain = otherExample.com

example.com/test.htm contains:

iframe src=otherExample.com/test2.htm

I want test2.htm to have access to the contents of test.htm. I can do
this using selectors like $("p",top.document) ONLY if test2.htm is
loaded from example.com rather than from otherExample.com. As soon as
it's loaded from otherExample.com, it can't get access to the contents
of example.com/test.htm

Is it possible to do this?

thanks in advance


[jQuery] Re: Newbie Question....

2009-07-17 Thread Greg Evans


That looks great, and I think it is just what I need. I want to  
clarify however, this shows to comment.php, but something like  
comment.pl should work equally as well correct?



On Jul 17, 2009, at 11:28 AM, brian wrote:



Do you want the form to submit via AJAX? Have a look at the form  
plugin.


http://malsup.com/jquery/form/

On Fri, Jul 17, 2009 at 1:47 PM, raisputin  
wrote:


Hello,

I have just discovered jQuery and it looks cool. I used the jQuery UI
builder at ui.jquery.com to build the UI and it looks and works
great :) Unfortunately I do not know enough about javascript to  
answer

my own question, so I am deferring to you :)

I would like to have a tab with a dialog button on it, and when that
dialog comes up there will be a form. This part I can do easily  
enough
and have already implemented, however, what I need to do after that  
is

where I am stuck :(

I want the user to fill out the form, say there are fields like
"Customer Name" "Telephone Number" and "D.O.B." and once that form is
filled out, and the user clicks OK, I want it to do the proper
inserts, etc into my mysql database. This is probably a very easy
question, but I have not found out anything useful so far through
various google searches. I would like to do the bulk of my mysql  
stuff

via perl/mason. Is there a tutorial anywhere for this or perhaps I
should be using a different technique? I am trying to avoid PHP  
simply

because I would prefer to not have to learn PHP while I am in the
process of learning the things I need for jQuery, but I can if I need
to.

Any advice/help/examples would be greatly appreciated.,

Greg Evans




[jQuery] Re: Newbie Question....

2009-07-17 Thread brian

Do you want the form to submit via AJAX? Have a look at the form plugin.

http://malsup.com/jquery/form/

On Fri, Jul 17, 2009 at 1:47 PM, raisputin wrote:
>
> Hello,
>
> I have just discovered jQuery and it looks cool. I used the jQuery UI
> builder at ui.jquery.com to build the UI and it looks and works
> great :) Unfortunately I do not know enough about javascript to answer
> my own question, so I am deferring to you :)
>
> I would like to have a tab with a dialog button on it, and when that
> dialog comes up there will be a form. This part I can do easily enough
> and have already implemented, however, what I need to do after that is
> where I am stuck :(
>
> I want the user to fill out the form, say there are fields like
> "Customer Name" "Telephone Number" and "D.O.B." and once that form is
> filled out, and the user clicks OK, I want it to do the proper
> inserts, etc into my mysql database. This is probably a very easy
> question, but I have not found out anything useful so far through
> various google searches. I would like to do the bulk of my mysql stuff
> via perl/mason. Is there a tutorial anywhere for this or perhaps I
> should be using a different technique? I am trying to avoid PHP simply
> because I would prefer to not have to learn PHP while I am in the
> process of learning the things I need for jQuery, but I can if I need
> to.
>
> Any advice/help/examples would be greatly appreciated.,
>
> Greg Evans


[jQuery] Re: show dynamic changes when a refresh occurs

2009-07-17 Thread James

The ideal way is to only show the popup alert when the user actually
has modified something on the form. So if the user visit the page,
does nothing, hits refresh, the alert should not pop up. If it does
it'll annoy the user. Add it only when the form info is changed, and
the user is not submitting the form.
A good way is like something like this:

// global variable
// false means do not alert
// default to not show alert
var showAlert = false;

// function form onbeforeunload event
function warnUser() {
if (showAlert) return 'Are you sure you want to leave?';
else return;  // this should not pop up an alert if you return
null or nothing
}

// bind event
window.onbeforeunload = warnUser;

// add event check for form changes
// change depending on how your form is laid out
$("input").change(function() {
// set showAlert to true so message will pop up
showAlert = true;
});

// turn off alert when submitting
// #myForm is your form ID
$("#myForm").submit(function) {
// turn off the alert
showAlert = false;
// do any necessary validation here
if (form_is_valid) {
// do something, or nothing to let the form submit
}
else {
// no go, turn alert back on again
showAlert = true;
return false;  // so form doesn't submit
}
});



On Jul 17, 5:19 am, Terry  wrote:
> Thanks for the ideas. The onbeforeunload event sounds like what I
> need.
>
> I did try the hidden field already. As you guessed it does not work;
> you need to get the data to know how many fields to create dynamically
> and then it is too late to have the dynamic fields filled in I'm
> guessing.
>
> Now I have a coding question about using the onbeforeunload with
> jquery.
> The onbeforeunload event is working to stop a refresh like I want, but
> it also is prompting during a submit which I do not want.
> I can't seem to figure out how to turn off the event handler.
>
> First, is this proper way to use the event with jquery?
> Is the onbeforeunload firing before the onclick? Is this something to
> do with jquery
>
> I added the event handler to the jquery ready handler
> $(document).ready(function() {
>     window.onbeforeunload = closeIt;
>     $("OBBtn_Save").onbeforeunload = null;   //tried this as an
> alternative to onclick with no luck
>     $("#divBoxes input:last").bind("change", appendBoxField);
>     $("#divBags input:last").bind("change", appendBagField);
>     //alert(document.forms.length);
>
> });
>
> I created a handler
> function closeIt() {
>     return "You will lose any data if you close or refresh the window
> at this point!";
>
> }
>
> and I want to remove the event handler when they submit the form
>         
>              onclick="onclick();" />
>             
>         
> function onclick() {
>     window.onbeforeunload = null;
>     return true;
>
> }
>
> Thanks,
>
> Terry
>
> On Jul 16, 7:42 pm, James  wrote:
>
> > The data is still there since the browser does a cache of the form
> > info, but dynamically created elements do not get cached in the same
> > way, unfortunately.
>
> > I haven't tried this before, but one thing you can try is to have a
> > hidden input in your form, and the purpose of this is to store the
> > number of fields you have dynamically generated. Every time you add/
> > remove fields, you update this number. Then on page load, you populate
> > the form with this many extra fields. However, since I haven't tried
> > this before, I'm guessing that the new fields will not be pre-
> > populated like the other static fields
> > I don't think there really is any good workaround for that except to
> > constantly save the form data to a cookie or to a database (via AJAX).
>
> > Another is to use the onbeforeunload event handler which is triggered
> > right before a page is left/re-loaded, and a prompt will be given,
> > which can be canceled and the refresh will not occur. (Google Groups
> > uses this when you type a message and try to leave/refresh the page.)
> > Just do a Google search on this and you'll find out lots about it.
>
> > On Jul 16, 12:46 pm, Terry  wrote:
>
> > > Hi, I have a moderate level of experience with javascript, and a good
> > > oo background. So, when I tried jquery I'm really liking it.
>
> > > I have a requirement to add input fields dynamically to the form since
> > > I don't know ahead of time how many entries the user may request. I
> > > was able to implement this with jquery very quickly with a small
> > > amount of code.
>
> > > When the form is submitted it is sent to the server with all of the
> > > data correctly passed. However, if I do a refresh, the dynamic fields
> > > go away, but the static fields still have data in them so I assuming
> > > that the dynamic data is still there.
>
> > > How can I verify this? When I show source, it only shows the original
> > > code; same even before the form is submitted. Is there a way to stop a
> > > refresh? This application may have 10 added fields or 3

[jQuery] disable click event while dragging (sortable)

2009-07-17 Thread Christopher
Hello Everybody!

Does somebody know how deactivate the click event on a dragable item while
dragging.
I tried to unbind the click event on start, and bind it again on stop. but
the initial click (=toggle) is still fired.

Thx everybody! i hope i made my problem clear ;/

chris

var $sortable = $(".containerCenterPDF .contentList").sortable({
> placeholder: 'dragHighlight',
> items:'.toogleBox',
> start: function(e) {
> //console.log('start')
> $('.toogleBox h2 a', this).unbind("click");
> },
> stop: function(e) {
> //console.log('stop')
> $('.toogleBox h2 a').click(function(){
> $(this).trigger('toggleBox');
> });
> })


$('.toogleBox h2 a').bind('toggleBox',function(){
> $(this).parent().parent().toggleClass('toogleBoxOpen');
> return false;
> }).click(function(){
> console.log('normal')
> $(this).trigger('toggleBox');
> });
>


[jQuery] Newbie Question....

2009-07-17 Thread raisputin

Hello,

I have just discovered jQuery and it looks cool. I used the jQuery UI
builder at ui.jquery.com to build the UI and it looks and works
great :) Unfortunately I do not know enough about javascript to answer
my own question, so I am deferring to you :)

I would like to have a tab with a dialog button on it, and when that
dialog comes up there will be a form. This part I can do easily enough
and have already implemented, however, what I need to do after that is
where I am stuck :(

I want the user to fill out the form, say there are fields like
"Customer Name" "Telephone Number" and "D.O.B." and once that form is
filled out, and the user clicks OK, I want it to do the proper
inserts, etc into my mysql database. This is probably a very easy
question, but I have not found out anything useful so far through
various google searches. I would like to do the bulk of my mysql stuff
via perl/mason. Is there a tutorial anywhere for this or perhaps I
should be using a different technique? I am trying to avoid PHP simply
because I would prefer to not have to learn PHP while I am in the
process of learning the things I need for jQuery, but I can if I need
to.

Any advice/help/examples would be greatly appreciated.,

Greg Evans


[jQuery] Re: getScript() issue under ie6 (undefined variable)

2009-07-17 Thread Olivier

Well, I have tried with real ie6 under windows XP and I get the same
error. It seems the script is not executed. Could it be a jquery bug ?

On 14 juil, 14:32, Olivier  wrote:
> Hi,
>
> I'm usinggetScriptto load a script which basically contains a
> variable, and then i'm using this variable in the callback function.
>
> It looks like that :
> $.getScript( myScriptURL, function() {
>         // execute this code on success
>         $("div#result").html(myVar.content);
>
> });
>
> and, the script i am loading (@ myScriptURL) is simply :
> var myVar = {
>         content: 'http://awebsite.com/foo.jpg"; />'
>
> };
>
> It works fineunderFF, Opera and Safari, but it doesn't workunder
> ie6.
> I get this error : "myVar is undefined" at the line which corresponds
> to $("div#result").html(myVar.content);
>
> Any idea about how to fix it ?
> Has someone already tested this kind of codeunderie6 ? Actually i'm
> using ie6 via Wine on Ubuntu and i was wondering if this bug only
> exists with my version of ie6.
>
> Thanks in advance.
> -Olivier


[jQuery] Re: get hover function behave right

2009-07-17 Thread Theodore Ni
Define
var curwidth;
var curheight;

outside of any functions or jQuery blocks. Then, refer to them inside your
functions without the var in front.

Ted


On Fri, Jul 17, 2009 at 1:01 PM, runrunforest  wrote:

>
> make the curwidth and curheight variables global, could you help me?
>
>


[jQuery] Re: get hover function behave right

2009-07-17 Thread runrunforest

make the curwidth and curheight variables global, could you help me?



[jQuery] Re: get height from hidden element

2009-07-17 Thread amuhlou

good point, Charlie.

http://docs.jquery.com/UI/Tabs#Why_does...



On Jul 17, 12:37 pm, Charlie  wrote:
> there are methods explained in UI tabs docs how to handle this
> amuhlou wrote:Perhaps you can try grabbing the element's height just before 
> you initiate tabs (assuming you're not pulling in the tabs via ajax)? On Jul 
> 17, 5:47 am, Davidwrote:Hi, my problem is, when I 
> try to get the height or any other graphic property of an element which is 
> hidden (in my case, hidden in one jQuery UI tab), I can't manage to get the 
> height of the element. If I do: $("#my_element").outerHeight() I get zero. 
> Whereas If I do the same when the element is visible, I get its height. I 
> work with jQuery 1.3.2 and FF 3.5. What am I doing wrong? Thanks!


[jQuery] Re: Menu display problem in Superfish

2009-07-17 Thread Charlie





there are no restrictions in superfish script or default CSS. To test
I've created as many as 8 levels of subs. More than likely your issues
are related to your CSS.

Is this a Joomla or other CMS install? 

neel wrote:

  Hi,

When the number of menus (including a menu and its submenus) reach a
particular number, then after that rest of the menus are not getting
displayed. Is there any settings available to restrict number of menus
in superfish?

Regards,
Nilanjan

  






[jQuery] Re: Replace an element with only opening or close element tag

2009-07-17 Thread Charlie





might consider using a filter to locate the elements between the hr's
and use wrapAll(), then remove the hr's


Liam Byrne wrote:

If you do what you're thinking, then every second content element would
be OUTSIDE of any 
  
  
What (I think) you need to do is:
  
  
FIRST  : OPEN DIV
  
LAST  : CLOSE DIV
  
EVERY IN-BETWEEN  CLOSE DIV FOLLOWED BY OPEN DIV
  
  
If you don't do all of those in a single step, however, I'd suspect
that the browser will detect an open, unclosed DIV and "interpret" it,
adding the closing div automatically.
  
  
L
  
  
Evert wrote:
  
  Hi there,


I am a newbie at using jquery and now I stumbled upon a problem. With

Jquery I want to replace each  with a  opening
tag or a 
div> closing tag. This way I would like to place a large page of

content in different divs.


Now I have this code :


var counter = 0;

for(var i = 0; i < $('hr').size(); i++){

    if(counter == 0){

    $("hr:eq(i)").replaceWith("");

    counter++;

 }else if(counter == 1){

    $("hr:eq(i)").replaceWith("");

    counter = 0;

  }

}


But it replaces every  with a open and close 
tag. Anyone

knows how I could get this working?

 




No virus found in this incoming message.

Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database:
270.13.18/2243 - Release Date: 07/17/09 06:08:00


  
  
  






[jQuery] Re: get height from hidden element

2009-07-17 Thread Charlie





there are methods explained in UI tabs docs how to handle this

amuhlou wrote:

  Perhaps you can try grabbing the element's height just before you
initiate tabs (assuming you're not pulling in the tabs via ajax)?


On Jul 17, 5:47 am, David  wrote:
  
  
Hi,

my problem is, when I try to get the height or any other graphic
property of an element which is hidden (in my case, hidden in one
jQuery UI tab), I can't manage to get the height of the element. If I
do:

$("#my_element").outerHeight()

I get zero. Whereas If I do the same when the element is visible, I
get its height.

I work with jQuery 1.3.2 and FF 3.5.

What am I doing wrong?

Thanks!

  
  
  






[jQuery] Re: Input that allows only numbers.

2009-07-17 Thread Cesar Sanz


try this http://www.texotela.co.uk/code/jquery/numeric/

- Original Message - 
From: "Caio Landau" 

To: "jQuery (English)" 
Sent: Friday, July 17, 2009 9:45 AM
Subject: [jQuery] Re: Input that allows only numbers.



So let me get it, key's code numbered between (and including) 48 and
57 are numbers?

Ok, I got it, thank you :)

On Jul 17, 11:18 am, Matt Zagrabelny  wrote:

On Thu, 2009-07-16 at 16:12 -0700, Caio Landau wrote:
> Well, that a simple question, I hope. I have an input ( type="text" />) on my page, and I want it to only accept numbers, so
> if the user types anything that's not a number, it will be removed
> instantly.

> A simplified example just to illustrate:

> 
>  
> 

This works for me...





$(function() {
$('#numbersonly').keypress(
function(event) {
return ((event.which >= 48) && (event.which <= 57));
}
);});








Cheers,

--
Matt Zagrabelny - mzagr...@d.umn.edu - (218) 726 8844
University of Minnesota Duluth
Information Technology Systems & Services
PGP key 1024D/84E22DA2 2005-11-07
Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2

He is not a fool who gives up what he cannot keep to gain what he cannot
lose.
-Jim Elliot

signature.asc
< 1KViewDownload


[jQuery] Re: ajaxStart() ajaxStop() problem

2009-07-17 Thread Cesar Sanz


Maybe the ajax in not firing again...

Have you checked the ajax calls with firebug?

besides, are you using IE for this? Think IE catch ajax calls when using 
$.get or $.load .. try $.post or $.ajax
- Original Message - 
From: "Jedrin" 

To: "jQuery (English)" 
Sent: Thursday, July 09, 2009 4:19 PM
Subject: [jQuery] ajaxStart() ajaxStop() problem




I have a page that has ajaxStart/stop as shown below to show some sort
of indicator while an ajax request is in progress. The first time an
ajax event happens, it works perfectly, the server renders some text
on the page. After that it stops working on subsequent ajax requests.
I don't see any javascript errors. Am I dong something wrong or how
could I troubleshoot ? thanks



Loading ..


..
..



$(document).ready(function(){
$("#loading").ajaxStart(function(){
 $(this).show();
});
});

$(document).ready(function(){
$("#loading").ajaxStop(function(){
 $(this).hide();
});
});


[jQuery] Re: Dynamic Links


On Fri, Jul 17, 2009 at 3:34 AM, Pradeep
Chandrasekaran wrote:
>
> Hi Brian,
>
> This returns the id perfectly, but how to overlay for each id??

That depends on the overlay code. There are many ways to do that. If
you have a function for positioning the overlay and loading the
content of some div, just pass it the ID.


[jQuery] Re: Input that allows only numbers.

On Fri, 2009-07-17 at 08:45 -0700, Caio Landau wrote:
> So let me get it, key's code numbered between (and including) 48 and
> 57 are numbers?

I used an "alert" dialog to determine the keycodes, you could probably
also use an ascii chart.

You also may want to include the codes for:

backspace
arrow keys
delete
etc.

Cheers,

> 
> On Jul 17, 11:18 am, Matt Zagrabelny  wrote:
> > On Thu, 2009-07-16 at 16:12 -0700, Caio Landau wrote:
> > > Well, that a simple question, I hope. I have an input ( > > type="text" />) on my page, and I want it to only accept numbers, so
> > > if the user types anything that's not a number, it will be removed
> > > instantly.
> >
> > > A simplified example just to illustrate:
> >
> > > 
> > >  
> > > 
> >
> > This works for me...
> >
> > 
> > 
> >  > src="/usr/share/javascript/jquery/jquery.js">
> > 
> > $(function() {
> >   $('#numbersonly').keypress(
> > function(event) {
> >   return ((event.which >= 48) && (event.which <= 57));
> > }
> >   );});
> >
> > 
> > 
> > 
> >   
> > 
> > 
> >
> > Cheers,
> >
> > --
> > Matt Zagrabelny - mzagr...@d.umn.edu - (218) 726 8844
> > University of Minnesota Duluth
> > Information Technology Systems & Services
> > PGP key 1024D/84E22DA2 2005-11-07
> > Fingerprint: 78F9 18B3 EF58 56F5 FC85  C5CA 53E7 887F 84E2 2DA2
> >
> > He is not a fool who gives up what he cannot keep to gain what he cannot
> > lose.
> > -Jim Elliot
> >
> >  signature.asc
> > < 1KViewDownload
-- 
Matt Zagrabelny - mzagr...@d.umn.edu - (218) 726 8844
University of Minnesota Duluth
Information Technology Systems & Services
PGP key 1024D/84E22DA2 2005-11-07
Fingerprint: 78F9 18B3 EF58 56F5 FC85  C5CA 53E7 887F 84E2 2DA2

He is not a fool who gives up what he cannot keep to gain what he cannot
lose.
-Jim Elliot


signature.asc
Description: This is a digitally signed message part


[jQuery] Re: Replace an element with only opening or close element tag



If you do what you're thinking, then every second content element would 
be OUTSIDE of any 


What (I think) you need to do is:

FIRST  : OPEN DIV
LAST  : CLOSE DIV
EVERY IN-BETWEEN  CLOSE DIV FOLLOWED BY OPEN DIV

If you don't do all of those in a single step, however, I'd suspect that 
the browser will detect an open, unclosed DIV and "interpret" it, adding 
the closing div automatically.


L

Evert wrote:

Hi there,

I am a newbie at using jquery and now I stumbled upon a problem. With
Jquery I want to replace each  with a  opening tag or a  closing tag. This way I would like to place a large page of
content in different divs.

Now I have this code :

var counter = 0;
for(var i = 0; i < $('hr').size(); i++){
if(counter == 0){
$("hr:eq(i)").replaceWith("");
counter++;
 }else if(counter == 1){
$("hr:eq(i)").replaceWith("");
counter = 0;
  }
}

But it replaces every  with a open and close  tag. Anyone
knows how I could get this working?
  




No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.387 / Virus Database: 270.13.18/2243 - Release Date: 07/17/09 06:08:00


  




[jQuery] Re: Set Element Position



GET

x=$("#elementName").offset().left;
y=$("#elementName").offset().top;

SET

$("#anotherElementName").css({left:x,top:y});


NoMatter wrote:

Hi Guys ,
Its my first time here. My Question is ..
When a button click , I need to change the positions of few DIVs .
How do I assign X and Y .
I saw there is a way of get Element's X , and Y but how to Setting X
and Y .

Thanks in advance,



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.387 / Virus Database: 270.13.18/2243 - Release Date: 07/17/09 06:08:00


  




[jQuery] Re: Set Element Position


I think this is what your looking for

http://www.west-wind.com/Weblog/posts/517320.aspx

found with quick google search

Mean Mike

On Jul 16, 10:18 pm, NoMatter  wrote:
> Hi Guys ,
> Its my first time here. My Question is ..
> When a button click , I need to change the positions of few DIVs .
> How do I assign X and Y .
> I saw there is a way of get Element's X , and Y but how to Setting X
> and Y .
>
> Thanks in advance,


[jQuery] Re: draggable with select field


btw please don't double post

On Jul 17, 11:50 am, Mean Mike  wrote:
> I'm pretty sure you need to use it with  or  I don't
> think you can use a select box
>
> if you don't need to to be sortable then i would recommend something
> like having two select boxes and moving them over
>
> something like this
>
> [code]
> //these are two buttons
>     $('#add').click(function() {
>         return ! $('#select_box_1 option:selected').remove().appendTo
> ('#select_box_2');
>     });
>
>     $('#remove').click(function() {
>         return ! $('##select_box_2 option:selected').remove().appendTo
> ('##select_box_1');
>     });
> [/code]
>
> follow ?
>
> Mean Mike
>
> On Jul 17, 7:42 am, sken  wrote:
>
> > Trying to get the draggable ui working with a multiple select field,
> > but doesn't work.
> > Does it actually work with option fields ?
>
> > $("select option").draggable();
>
> > it adds the ui-draggable class to the options fields, but they are not
> > draggable :(


[jQuery] Re: draggable with select field


I'm pretty sure you need to use it with  or  I don't
think you can use a select box

if you don't need to to be sortable then i would recommend something
like having two select boxes and moving them over

something like this

[code]
//these are two buttons
$('#add').click(function() {
return ! $('#select_box_1 option:selected').remove().appendTo
('#select_box_2');
});

$('#remove').click(function() {
return ! $('##select_box_2 option:selected').remove().appendTo
('##select_box_1');
});
[/code]

follow ?

Mean Mike

On Jul 17, 7:42 am, sken  wrote:
> Trying to get the draggable ui working with a multiple select field,
> but doesn't work.
> Does it actually work with option fields ?
>
> $("select option").draggable();
>
> it adds the ui-draggable class to the options fields, but they are not
> draggable :(


[jQuery] Re: Get the HTML of the current node plus its Inner HTML


Theordore,

The function worked like a charm.  Thanks man and for everyone who
pitched in.

On Jul 16, 5:11 pm, Theodore Ni  wrote:
> I was going to work on a proof of concept, but then I had the idea to see if
> anyone else has already implemented this. Sure enough, Brandon Aaron 
> has:http://brandonaaron.net/blog/2007/06/17/jquery-snippets-outerhtml
> 
> Ted
>
> On Thu, Jul 16, 2009 at 3:06 PM, bittermonkey  wrote:
>
> > Hi,
>
> > I need to get all the TABLE HTML code within the  tag for a
> > content-generating application.  I'm trying to use the html() method,
> > but it only gets the inner HTML.  I also tried clone(), but does the
> > same thing. Or maybe I'm using it wrong.  Here's an example to clarify
> > what I wanted to do:
>
> > Input
> > 
> > 
> > some text
> >  > table>
> > ...
> >  > table>
> > 
>
> > Output
> > 
> >  > table>
> >  > table>
>
> > jQuery Code
> > 
> > $("body").children().each(function(){
> >  var contentHtml = "";
> >  if(this.nodeName.toLowerCase() == "table")
> >  {
> >    //need to include the  code here
> >    contentHtml += $(this).html();
> >  }
> > });
>
> > Thanks in advance.


[jQuery] Re: Input that allows only numbers.


So let me get it, key's code numbered between (and including) 48 and
57 are numbers?

Ok, I got it, thank you :)

On Jul 17, 11:18 am, Matt Zagrabelny  wrote:
> On Thu, 2009-07-16 at 16:12 -0700, Caio Landau wrote:
> > Well, that a simple question, I hope. I have an input ( > type="text" />) on my page, and I want it to only accept numbers, so
> > if the user types anything that's not a number, it will be removed
> > instantly.
>
> > A simplified example just to illustrate:
>
> > 
> >  
> > 
>
> This works for me...
>
> 
> 
>  src="/usr/share/javascript/jquery/jquery.js">
> 
> $(function() {
>   $('#numbersonly').keypress(
>     function(event) {
>       return ((event.which >= 48) && (event.which <= 57));
>     }
>   );});
>
> 
> 
> 
>   
> 
> 
>
> Cheers,
>
> --
> Matt Zagrabelny - mzagr...@d.umn.edu - (218) 726 8844
> University of Minnesota Duluth
> Information Technology Systems & Services
> PGP key 1024D/84E22DA2 2005-11-07
> Fingerprint: 78F9 18B3 EF58 56F5 FC85  C5CA 53E7 887F 84E2 2DA2
>
> He is not a fool who gives up what he cannot keep to gain what he cannot
> lose.
> -Jim Elliot
>
>  signature.asc
> < 1KViewDownload


[jQuery] Re: jquery ui dialog get element from button


Carlo,

jQuery /javascript is procedural  so you just need to move things
around

like this
[code]
$(document).ready(function(){
$("#dialog").dialog({
autoOpen:false,
modal:true,
overlay: {backgroundColor: "#000",opacity: 0.5},
resizable:false,
buttons:{
  "Delete": function() {window.location = "/home/" + $somevar 
;},
  "Cancel": function() {$(this).dialog("close");}
}
});
$(".button").click(function(){
$("#ui-dialog-title-dialog").text("Attention");
var message = "You are about to do something: ";
$(".ui-dialog-content").text($message + $(this).attr("id"));
var somevar = $(this).attr("id");
$("#dialog").dialog("open");
});
});
[/code]

I also noticed that your mixing php variables with javascript
variables i.e. javascript variables do not use "$" I'm not sure if
this causes any problems but I removed them

Mike

On Jul 17, 9:54 am, Carlo Landmeter  wrote:
> I will try that ones I have tackled the following issue.
>
> I keep having issues with dialog because the dialog is created before
> i use the .click function. Because of this i cannot change some
> options of the dialog. For instance:
>
> If i click the button i am able to retrieve the id of this button and
> use it. problem is that my dialog function has to be loaded before i
> use the dialog(open) function. How am i able to insert the ID in the
> $somevar variable in my below example?
> The only way I can think of getting this done is putting the dialog
> function inside the .click function but for this we already have a
> dedicated function dialog(open). Any idea how to solve this?
>
> $(document).ready(function(){
>     $("#dialog").dialog({
>       autoOpen:false,
>       modal:true,
>       overlay: {backgroundColor: "#000",opacity: 0.5},
>       resizable:false,
>       buttons:{
>         "Delete": function() {window.location = "/home/" + $somevar ;},
>         "Cancel": function() {$(this).dialog("close");}
>       }
>     });
>     $(".button").click(function(){
>       $("#dialog").dialog("open");
>       $("#ui-dialog-title-dialog").text("Attention");
>       var $message = "You are about to do something: ";
>       $(".ui-dialog-content").text($message + $(this).attr("id"));
>       var $somevar = $(this).attr("id");
>     });
>
> });
> On Fri, Jul 17, 2009 at 1:14 AM, Charlie wrote:
> > sure, just add
>
> > $("#dialog").load("url") to click function you have
>
> > Carlo Landmeter wrote:
>
> > Thanks for your replies.
>
> > If I look at your first option I wouldn't know how i could know the
> > correct ID before i click the button but i have to initiate the dialog
> > open after the normal dialog function. You second option seems the
> > best way for me, after the dialog is created i can modify its content
> > with your suggested code. Now I still want to find if i can also load
> > a page with ajax (load) instead of a local div.
>
> > Thx again,
>
> > Carlo
>
> > code:
>
> > $(document).ready(function(){
> >     $("#dialog").dialog({
> >       autoOpen:false,
> >       modal:true,
> >       overlay: {backgroundColor: "#000",opacity: 0.5},
> >       resizable:false,
> >       buttons:{
> >         "Delete": function() {},
> >         "Cancel": function() {$(this).dialog("close");}
> >       }
> >     });
> >     $(".button").click(function(event){
> >       $("#dialog").dialog("open");
> >       $("#ui-dialog-title-dialog").text($(this).attr("id"));
> >     });
> > });';
>
> > this is a test
>
> > On Thu, Jul 16, 2009 at 3:55 PM, Charlie wrote:
>
> > dialog has a setter option for title, it isn't really a title attiribute.
> > The dialog "title is actually a span with class ui-dialog-title-dialog
> >http://jqueryui.com/demos/dialog/#option-title
>
> > $('.selector').dialog('option', 'title', 'Dialog Title');
>
> > either pass the id into the option or you can use
>
> > $(".button").click(function(event){
>
> >         $('#dialog').dialog('open');
> >          $('. ui-dialog-title-dialog ').text($(this).attr("id"));
> >     });
>
> > constructor must be separate as Mike pointed out
>
> > Mean Mike wrote:
>
> > Yes that is correct you need to separate  the dialog from the open
>
> > like this note: I set the autoOpen to false.
>
> > [code]
> > $(document).ready(function(){
> >    $(".button").click(function(event){
> >            $("#dialog").attr("title", event.target.id);
> >            $('#dialog').dialog('open');
> >    });
>
> >    $("#dialog").dialog({
> >      autoOpen:false,
> >      modal:true,
> >      overlay: {backgroundColor: "#000",opacity: 0.5},
> >      resizable:false,
> >      buttons:{
> >        "Delete": function() {},
> >        "Cancel": function() {$(this).dialog("close");}
> >      }
> >    });
> > });
> > [/code]
>
> > let me know how that works out for you
> > Mean Mike
>
> >

[jQuery] Re: get height from hidden element


Perhaps you can try grabbing the element's height just before you
initiate tabs (assuming you're not pulling in the tabs via ajax)?


On Jul 17, 5:47 am, David  wrote:
> Hi,
>
> my problem is, when I try to get the height or any other graphic
> property of an element which is hidden (in my case, hidden in one
> jQuery UI tab), I can't manage to get the height of the element. If I
> do:
>
> $("#my_element").outerHeight()
>
> I get zero. Whereas If I do the same when the element is visible, I
> get its height.
>
> I work with jQuery 1.3.2 and FF 3.5.
>
> What am I doing wrong?
>
> Thanks!


[jQuery] Re: any yone know how biocompare styled the thickbox


I tried using thickbox and didn't like it there was some bigger reason
why i didn't like it i just don't remember what it was now its been
awhile now. I am already using jquery-ui for other things so it seemed
logical as well that I should stick with ui thereby keeping the code
tighter

Mean Mike

On Jul 17, 10:11 am, SeanthePaddy  wrote:
> mike thanks for suggestion - i may go and look at dialog
>
> out of interest why would u use that ?
> what are the pros and cons for each ?
>
> tnx
> sean
>
> On Jul 17, 3:36 pm, Mean Mike  wrote:
>
> > I wouldn't use thickbox I would use jquery-ui.dialog
>
> > but if you want to use thick box I suggest downloading thickbox and
> > maybe looking at the documentation
>
> > Mean Mike
>
> > On Jul 17, 9:23 am, SeanthePaddy  wrote:
>
> > > click signin on biocompare.com
>
> > > anyone know how i can do similar ?
>
> > > tnx
> > > sean


[jQuery] Re: show dynamic changes when a refresh occurs


Thanks for the ideas. The onbeforeunload event sounds like what I
need.

I did try the hidden field already. As you guessed it does not work;
you need to get the data to know how many fields to create dynamically
and then it is too late to have the dynamic fields filled in I'm
guessing.

Now I have a coding question about using the onbeforeunload with
jquery.
The onbeforeunload event is working to stop a refresh like I want, but
it also is prompting during a submit which I do not want.
I can't seem to figure out how to turn off the event handler.

First, is this proper way to use the event with jquery?
Is the onbeforeunload firing before the onclick? Is this something to
do with jquery


I added the event handler to the jquery ready handler
$(document).ready(function() {
window.onbeforeunload = closeIt;
$("OBBtn_Save").onbeforeunload = null;   //tried this as an
alternative to onclick with no luck
$("#divBoxes input:last").bind("change", appendBoxField);
$("#divBags input:last").bind("change", appendBagField);
//alert(document.forms.length);
});

I created a handler
function closeIt() {
return "You will lose any data if you close or refresh the window
at this point!";
}

and I want to remove the event handler when they submit the form




function onclick() {
window.onbeforeunload = null;
return true;
}

Thanks,

Terry


On Jul 16, 7:42 pm, James  wrote:
> The data is still there since the browser does a cache of the form
> info, but dynamically created elements do not get cached in the same
> way, unfortunately.
>
> I haven't tried this before, but one thing you can try is to have a
> hidden input in your form, and the purpose of this is to store the
> number of fields you have dynamically generated. Every time you add/
> remove fields, you update this number. Then on page load, you populate
> the form with this many extra fields. However, since I haven't tried
> this before, I'm guessing that the new fields will not be pre-
> populated like the other static fields
> I don't think there really is any good workaround for that except to
> constantly save the form data to a cookie or to a database (via AJAX).
>
> Another is to use the onbeforeunload event handler which is triggered
> right before a page is left/re-loaded, and a prompt will be given,
> which can be canceled and the refresh will not occur. (Google Groups
> uses this when you type a message and try to leave/refresh the page.)
> Just do a Google search on this and you'll find out lots about it.
>
> On Jul 16, 12:46 pm, Terry  wrote:
>
>
>
> > Hi, I have a moderate level of experience with javascript, and a good
> > oo background. So, when I tried jquery I'm really liking it.
>
> > I have a requirement to add input fields dynamically to the form since
> > I don't know ahead of time how many entries the user may request. I
> > was able to implement this with jquery very quickly with a small
> > amount of code.
>
> > When the form is submitted it is sent to the server with all of the
> > data correctly passed. However, if I do a refresh, the dynamic fields
> > go away, but the static fields still have data in them so I assuming
> > that the dynamic data is still there.
>
> > How can I verify this? When I show source, it only shows the original
> > code; same even before the form is submitted. Is there a way to stop a
> > refresh? This application may have 10 added fields or 300 added
> > fields, and if the user does a refresh for some reason he'll want to
> > see every thing that has been input so far.
>
> > my code:
> > $(document).ready(function() {
> >     $("#divBoxes input:last").bind("change", appendBoxField);
> >     $("#divBags input:last").bind("change", appendBagField);});
>
> > function appendBoxField() {
> >     var len = $("#divBoxes input").length + 1;
> >     //alert(len);
> >     $("#divBoxes").append(' > name="_UPS_Shipping_Label_' + len + '" />')
> >     $(this).unbind("change", appendBoxField);
> >     $("#divBoxes input:last").bind("change", appendBoxField).focus();}
>
> > function appendBagField() {
> >     var len = $("#divBags input").length + 1;
> >     //alert(len);
> >     $("#divBags").append('')
> >     $(this).unbind("change", appendBagField);
> >     $("#divBags input:last").bind("change", appendBagField).focus();
>
> > }
>
> > Thanks,
>
> > Terry- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Detecting a redirect response to an Ajax query


another solution would be to launch a client-side javascript timeout
function that redirects user to login/signup page after session
validity time has passed (say, 15 minutes). this way user wouldn't
need to be redirected after clicking a link.

in one site i saw a similar solution:
- user opens a page and does nothing (nor with mouse or keyboard).
- a minute untill the session expires, user is presented with dialog
box that says something like "do something or you'll be logged out in
60 {and counting} seconds".
- if user moves a mouse or presses a key - the dialog disappears and
session is continued (some sort of "ping" is done via ajax to notify
server side of user's activity)
- if user is absent (i.e. no activity is detected in 60 minutes) user
gets redirected to login/singup page.


[jQuery] Re: Input that allows only numbers.

On Thu, 2009-07-16 at 16:12 -0700, Caio Landau wrote:
> Well, that a simple question, I hope. I have an input ( type="text" />) on my page, and I want it to only accept numbers, so
> if the user types anything that's not a number, it will be removed
> instantly.
> 
> A simplified example just to illustrate:
> 
> 
>  
> 

This works for me...





$(function() {
  $('#numbersonly').keypress(
function(event) {
  return ((event.which >= 48) && (event.which <= 57));
}
  );
});



  



Cheers,

-- 
Matt Zagrabelny - mzagr...@d.umn.edu - (218) 726 8844
University of Minnesota Duluth
Information Technology Systems & Services
PGP key 1024D/84E22DA2 2005-11-07
Fingerprint: 78F9 18B3 EF58 56F5 FC85  C5CA 53E7 887F 84E2 2DA2

He is not a fool who gives up what he cannot keep to gain what he cannot
lose.
-Jim Elliot


signature.asc
Description: This is a digitally signed message part


[jQuery] Re: any yone know how biocompare styled the thickbox


mike thanks for suggestion - i may go and look at dialog

out of interest why would u use that ?
what are the pros and cons for each ?

tnx
sean

On Jul 17, 3:36 pm, Mean Mike  wrote:
> I wouldn't use thickbox I would use jquery-ui.dialog
>
> but if you want to use thick box I suggest downloading thickbox and
> maybe looking at the documentation
>
> Mean Mike
>
> On Jul 17, 9:23 am, SeanthePaddy  wrote:
>
> > click signin on biocompare.com
>
> > anyone know how i can do similar ?
>
> > tnx
> > sean


[jQuery] Re: Detecting a redirect response to an Ajax query


Many thanks for your input - this is now working perfectly. For the
benefit of the archives:

- In the server, where the session expiry is detected, I check for
XMLHttpRequest ("request.xhr?" in Rails)
- If so, I send back a 403 instead of the redirect to the login page
- At the client side, I have an error wrapper which detects the 403
and forces the browser to the login page

function ajax_error(fn) {
  return function(res, status, err) {
if (res.status == 403)
  location = "/signup/login";
else if (fn)
  return fn(res, status, err);
  }
}

$.ajax({
  ...
  error: ajax_error( function(res, status, err) {
// other error handling goes here
  })
})

Cheers,

Brian.


[jQuery] Re: File uploader with preview like box.net, etc.?


You'll see stuff like this leveraging Flash, because Flash is an
application on the end user's computers that have permissions to view
user's files on their computer, which is driving that "preview"
functionality

JavaScript wouldn't have the ability to do anything with the file
location

"C:\Users\Steve\Desktop\glacier1.jpg"

One it's up on the web, then it could do stuff with it, but not until
then


On Jul 16, 10:15 pm, donb  wrote:
> What was I smoking when I wrote that?  No, the site that had the
> 'nice' uploader was:
>
> http://www.element-it.com/Examples/MultiPowUpload/ThumbnailsViewerHTM...
>
> "Nice" in that it let's me select several files at once and has a
> scrolling region previewing all the pending uploads.  But it looks
> hidious.  And being a commercial product, advancement of it is
> destined to be a long, slow endeavor.
>
> On Jul 16, 9:34 pm, donb  wrote:
>
> > Seems the preview aspect is being a real bugger - I don't see anyone
> > successfully doing it with any of the current crop of jquery
> > uploaders.
>
> > There are a number of sites doing it, such as box.net which I think is
> > quite a nice one.
>
> > I found some info on the matter here:
>
> >http://blog.flexexamples.com/2008/08/25/previewing-an-image-before-up...
>
> > I have Flash 8 and found it nigh onto impossible to do anything
> > useful.  I wrestled with it for a time and finally quit, as it just
> > seemed so retarded AND it liked to randomly crash before I saved my
> > work.
>
> > So I'm very resistant to getting a Flash 10 upgrade.  I'm hoping
> > there's someone smarter than me tackling this monster.
>
> > Is that the case?  Anyone?
>
> > tnx,
>
> > Don


[jQuery] Re: jquery ui dialog get element from button


I will try that ones I have tackled the following issue.

I keep having issues with dialog because the dialog is created before
i use the .click function. Because of this i cannot change some
options of the dialog. For instance:

If i click the button i am able to retrieve the id of this button and
use it. problem is that my dialog function has to be loaded before i
use the dialog(open) function. How am i able to insert the ID in the
$somevar variable in my below example?
The only way I can think of getting this done is putting the dialog
function inside the .click function but for this we already have a
dedicated function dialog(open). Any idea how to solve this?

$(document).ready(function(){
$("#dialog").dialog({
  autoOpen:false,
  modal:true,
  overlay: {backgroundColor: "#000",opacity: 0.5},
  resizable:false,
  buttons:{
"Delete": function() {window.location = "/home/" + $somevar ;},
"Cancel": function() {$(this).dialog("close");}
  }
});
$(".button").click(function(){
  $("#dialog").dialog("open");
  $("#ui-dialog-title-dialog").text("Attention");
  var $message = "You are about to do something: ";
  $(".ui-dialog-content").text($message + $(this).attr("id"));
  var $somevar = $(this).attr("id");
});
});



On Fri, Jul 17, 2009 at 1:14 AM, Charlie wrote:
> sure, just add
>
> $("#dialog").load("url") to click function you have
>
> Carlo Landmeter wrote:
>
> Thanks for your replies.
>
> If I look at your first option I wouldn't know how i could know the
> correct ID before i click the button but i have to initiate the dialog
> open after the normal dialog function. You second option seems the
> best way for me, after the dialog is created i can modify its content
> with your suggested code. Now I still want to find if i can also load
> a page with ajax (load) instead of a local div.
>
> Thx again,
>
> Carlo
>
> code:
>
> $(document).ready(function(){
> $("#dialog").dialog({
>   autoOpen:false,
>   modal:true,
>   overlay: {backgroundColor: "#000",opacity: 0.5},
>   resizable:false,
>   buttons:{
> "Delete": function() {},
> "Cancel": function() {$(this).dialog("close");}
>   }
> });
> $(".button").click(function(event){
>   $("#dialog").dialog("open");
>   $("#ui-dialog-title-dialog").text($(this).attr("id"));
> });
> });';
>
> this is a test
>
> On Thu, Jul 16, 2009 at 3:55 PM, Charlie wrote:
>
>
> dialog has a setter option for title, it isn't really a title attiribute.
> The dialog "title is actually a span with class ui-dialog-title-dialog
> http://jqueryui.com/demos/dialog/#option-title
>
> $('.selector').dialog('option', 'title', 'Dialog Title');
>
> either pass the id into the option or you can use
>
> $(".button").click(function(event){
>
>         $('#dialog').dialog('open');
>          $('. ui-dialog-title-dialog ').text($(this).attr("id"));
>     });
>
> constructor must be separate as Mike pointed out
>
> Mean Mike wrote:
>
> Yes that is correct you need to separate  the dialog from the open
>
> like this note: I set the autoOpen to false.
>
> [code]
> $(document).ready(function(){
>   $(".button").click(function(event){
>   $("#dialog").attr("title", event.target.id);
>   $('#dialog').dialog('open');
>   });
>
>   $("#dialog").dialog({
> autoOpen:false,
> modal:true,
> overlay: {backgroundColor: "#000",opacity: 0.5},
> resizable:false,
> buttons:{
>   "Delete": function() {},
>   "Cancel": function() {$(this).dialog("close");}
> }
>   });
> });
> [/code]
>
> let me know how that works out for you
> Mean Mike
>
> On Jul 16, 8:31 am, Carlo Landmeter  wrote:
>
>
> Hi,
>
> I have probably a simple question which i cannot seem to find the
> answer to.
> I have a series of images which i want to use as buttons to trigger a
> dialog. Inside this dialog i need the ID of the image button (or any
> other element). But it seems after I load the dialog i cannot alter
> the content of it anymore. As an example I have tried to change the
> title of the #dialog so it will show the updated title when i click
> the button. The only way i am able to do this is when i put all of
> this inside the .click function and start with .attr function followed
> by the .dialog function. The problem is when i do this and close the
> dialog i cannot enable the dialog anymore. I guess this is why they
> have the .dialog("open").
> Is there a way i can achieve what I'm trying to do  here? Maybe there
> is a better way of doing this?
>
> Tia,
>
> Carlo
>
> code:
>
> $(document).ready(function(){
>   $(".button").click(function(event){
>     $("#dialog").attr("title", event.target.id);
>     $("#dialog").dialog({
>       autoOpen:true,
>       modal:true,
>       overlay: {backgroundColor: "#000",opacity: 0.5},
>       resizable:false,
>       buttons:{
>         "Delete": function

[jQuery] Re: slideUp(), slideDown() not working in IE 6, 7 on LI elements

I tried several approaches here and the animation bug in IE remains. I don't
know if it's a bug. Post this thread on the dev group.

On Thu, Jul 16, 2009 at 14:29, Bill  wrote:

>
> Is the best way forward to just rewrite the HTML so that it uses DIV
> elements instead of UL and LIs? There's got to be a better way...
>
> On Jul 15, 2:38 pm, Bill  wrote:
> > Leonardo, thanks very much for your reply.
> >
> > I've updated my code, so the third wrapper contains the following:
> >
> > 
> > Plain ol' UL,slideDown()
> > 
> > One
> > Two
> > Three
> > Four
> > Five
> > 
> > 
> >
> > And the jQuery code:
> >
> > /**
> >  * Fix...
> >  */
> >  $("#menu-1-fix li div").click(function(e) {
> > $(this).slideUp(2000, function() {
> > $(this).parent().hide(-1).remove();
> > });
> >  });
> >
> > But the problem persists inIE. Anyone know when the bug will be
> > fixed? Could I get around the problem using the animate() command?
> >
> > Regards
> >
> > --Bill
> >
> > On Jul 15, 1:34 pm, Leonardo K  wrote:
> >
> >
> >
> > >  You can put a DIV inside a LI and animate the DIV
> >
> > > 
> > >   content here 
> > > 
> >
> > > On Wed, Jul 15, 2009 at 16:31, Bill  wrote:
> >
> > > > Alright, so this *is* a bug:
> >
> > > >http://dev.jquery.com/ticket/3120
> >
> > > > Anyone have any advice on a workaround ?
> >
> > > > On Jul 15, 12:15 pm, Bill  wrote:
> > > > > Hi all,
> >
> > > > > I posted a week ago about some odd behavior with slideUp() and
> > > > >slideDown() inIE6, 7, and 8 (the post is here:
> > > >
> http://groups.google.com/group/jquery-en/browse_thread/thread/1b4cda0...
> > > > > ). After several hours of further investigation, it appears that
> > > > > jQuery isn't properly animating LI elements.
> >
> > > > > I set up a simplified example here:
> >
> > > > >http://69.59.182.148:4080/test/07152009/index.html
> >
> > > > > The first two examples on this page show slideUp() andslideDown()
> on
> > > > > LI elements. In Firefox, Chrome, Opera, and Safari, clicking causes
> > > > > slideUp() orslideDown() animations that behave as expected. InIE6
> > > > > and 7, slideUp() andslideDown() behave very differently.
> >
> > > > > The second two examples basically translate the unordered lists and
> > > > > list items into divs. slideUp() andslideDown() work as expected in
> > > > > these examples, even inIE6 and 7.
> >
> > > > > Is this a flaw in the slideUp()/slideDown() commands?
> >
> > > > > Regards,
> >
> > > > > --Bill
>


[jQuery] Re: Dynamic Links


Hi mnaveed,

Am also looking for the same solution. If you have overcome with this
problem, pl. let me know the solution.

Thanks,
Pradeep

On Jul 12, 9:46 pm, mnaveed  wrote:
> Hi,
> I am new to JQuery, can anyone help how to generate dynamic links. I
> have a loop which generate some links and for each, an onclick event
> is attached, calling a javascript method with some arguments. some
> thing like this,
>
> for(x = 0; x   Get data 
>
> how can i generate such a grid using Jquery. Actually i have to
> display an overlay on each click, and data will be loaded dynamically
> in the overlay, so how can i pass the ID to the method?
>
> Thanks


[jQuery] Replace an element with only opening or close element tag


Hi there,

I am a newbie at using jquery and now I stumbled upon a problem. With
Jquery I want to replace each  with a  opening tag or a  closing tag. This way I would like to place a large page of
content in different divs.

Now I have this code :

var counter = 0;
for(var i = 0; i < $('hr').size(); i++){
if(counter == 0){
$("hr:eq(i)").replaceWith("");
counter++;
 }else if(counter == 1){
$("hr:eq(i)").replaceWith("");
counter = 0;
  }
}

But it replaces every  with a open and close  tag. Anyone
knows how I could get this working?




[jQuery] Re: Dynamic Links


Hi Brian,

This returns the id perfectly, but how to overlay for each id??

On Jul 13, 8:16 pm, brian  wrote:
> That looks like a mix of PHP & javascript. Try this:
>
>  for($x = 0; $x < $items.length; $x++)
> {
> ?>
>          Get
> data 
> 
> ?>
>
> JS:
>
> $(function()
> {
>         $('a.Whatever').click(function()
>         {
>            alert($(this).attr('rel'));
>         })
>
>
>
> });
> On Mon, Jul 13, 2009 at 4:54 AM, mnaveed wrote:
>
> > sorry I did not clear my point, here is what i want to do,
> > I am running a PHP for loop, which generates a table. In the table, I
> > have a column in which links are generated with an onclick event and
> > the item id is set as parameter, so it looks like this,
>
> >  for(x = 0; x >  $str =. ' Get
> > data 
> > echo($str);
>
> > this is fine, but no i want to attach anoverlaywith these links,
> > there is only oneoverlayon my page which will be displayed when any
> > of the above link is clicked. Data will be loaded from the server. Now
> > how can i pass the current items id from the above link to the jquery
> > methods foroverlay?
>
> > I hope I am able to clear my point..
>
> > Thanks.
>
> > On Jul 12, 10:19 pm, brian  wrote:
> >> On Sun, Jul 12, 2009 at 12:46 PM, mnaveed wrote:
>
> >> > Hi,
> >> > I am new to JQuery, can anyone help how to generatedynamiclinks. I
> >> > have a loop which generate somelinksand for each, an onclick event
> >> > is attached, calling a javascript method with some arguments. some
> >> > thing like this,
>
> >> > for(x = 0; x >> >  Get data 
>
> >> > how can i generate such a grid using Jquery. Actually i have to
> >> > display anoverlayon each click, and data will be loaded dynamically
> >> > in theoverlay, so how can i pass the ID to the method?
>
> >> Do you want to create thelinks? Where do you want them appended? One
> >> after the other? Or should they be appended to individual elements? If
> >> the latter, and let's say you have a structure like so:
>
> >> foo 
> >> foo 
> >> foo 
> >> foo 
> >> foo 
>
> >> ... you needn't create the loop yourself. You could do something like:
>
> >> $(function()
> >> {
> >>         $('.Items').each(function()
> >>         {
> >>                 $('get data')
> >>                         .click(function()
> >>                         {
> >>                                 alert($(this).parent().attr('id'));
> >>                         })
> >>                         .appendTo($(this));
> >>         });
>
> >> });
>
> >> Note that "this" inside the click handler refers to the link, while
> >> the appendTo($(this)) refers to the div.- Hide quoted text -
>
> - Show quoted text -


[jQuery] Problems with two Superfish menus


Hi guys,

I had a problem when I tried to use two Superfish menus. This problems
just occur when I use Internet Explorer 6.
Please, visit this URL to see the screenshot that explain everything.

My HTML doesn't have any special structure to cause this problem.

Can someone give me some idea about how to "solve" this problem?

Regards,
GB


[jQuery] draggable with select field


Trying to get the draggable ui working with a multiple select field,
but doesn't work.
Does it actually work with option fields ?

$("select option").draggable();

it adds the ui-draggable class to the options fields, but they are not
draggable :(


[jQuery] Input that allows only numbers.


Well, that a simple question, I hope. I have an input () on my page, and I want it to only accept numbers, so
if the user types anything that's not a number, it will be removed
instantly.

A simplified example just to illustrate:


 


Thanks


[jQuery] Menu display problem in Superfish


Hi,

When the number of menus (including a menu and its submenus) reach a
particular number, then after that rest of the menus are not getting
displayed. Is there any settings available to restrict number of menus
in superfish?

Regards,
Nilanjan


[jQuery] Large file upload problem for form plugin


Hello.

I'm using jQuery form plugin and there seems to be a problem with
files larger then approximately 10mb. If I try to upload a file that's
smaller then that it does everything correct, but if it's larger then
it just returns empty $_POST and empty $_FILES.

Any ideas on what may be the problem?

Here is the code:

$("#facebox #content_container").ajaxSubmit({
success: function(data) {
console.log(data);
}
});


[jQuery] select draggable


Trying to get the draggable ui working with a multiple select field,
but doesn't work.
Does it actually work with option fields ?

$("select option").draggable();

it adds the ui-draggable class to the options fields, but they are not
draggable :(


[jQuery] [ treeview ] lazy ajax with unique


Hello

i use treeview plugin with lazy ajax.
if use "unique" option it reload all items of current level that has
children, when open one of item.

so it could be about 20 ajax queries at one time.

is it possible to set one open click one query?


  1   2   >