I want to convert some existing code from traditional javascript for
loop to $.each. Here is my code:
var oEl = document.getElementById(my_form_id).elements;
for(var i=0; i oEl.length; i++) {
//do something
}
In jquery I have written a $.fn.extend function and the code as:
$.fn.extend({
You shouldn't need to use $.extend in this case. Something like this
should work:
jQuery.fn.debug = function() {
return this.each(function(){
alert(this);
});
};
Taken from http://docs.jquery.com/Plugins/Authoring
As for your selection code, you need to use find instead of
filter. The
You can check a var in jQuery using the following method:
?php
$my_php_var = Value;
?
script ...
var my_js_var = ?php echo $my_php_var; ?;
if (my_js_var == Value) {
alert(Value set);
}
/script
Thats one of the Q's down!
M
On Jan 13, 3:45 am, Nikola nik.cod...@gmail.com
Hi Brian and MorningZ,
There is nothing problem with first example.. I just wanted to see
different examples..
Thank you about that..
and thank you Karl,
This is exactly what I am looking for..
I haven't tried yet, I will try it..
BUMP
alexquery wrote:
I am creating a product/category tree using jquery. I would like to be
able to store additional data within each node.
The nodes in my tree are basicaly list elements. How would I add data to
these elements such as the count of products and categories beneath them
You could try the jQuery metadata plugin if you need the metadata to
be in the markup itself. If you don't then using data is probably a
better approach.
On Jan 12, 3:46 pm, alexquery alext...@gmail.com wrote:
I am creating a product/category tree using jquery. I would like to be able
to store
Hello All
This is what I am trying to do. I have defined an email suffix class
for a particular textbox element so that it accepts values for that
particular class. Whenever there is a different value inserted, it
displays a jquery error. Now, there also is an Add button which should
add the
ides anyone?
On 12 Jan., 17:43, dirk w dirkwendl...@googlemail.com wrote:
thanks a lot for your help!
is it possible to additionally explain me how i can execute this link
through the ajax functions? that would be great!
thanks in advance
On 12 Jan., 15:53, jQuery Lover
it's work, thanks
On 1月12日, 下午5時03分, Balazs Endresz balazs.endr...@gmail.com wrote:
Use filter with $.ajax:
$('#response').html($(res).filter('#a').text());
On Jan 12, 9:30 am, David .Wu chan1...@gmail.com wrote:
And I found the load is not work either, because it still get the
nope, it's doesn't work, I type the wrong character but something
interesting happened
$('#response').html($(res).filter('#a').text()); - it's not work
$('#response').html($(res).filter('$a').text()); - it's give me 123,
but not truly work,
$('#response').html($(res).text()); - it's not work
Hello,
On the site I am working on (http://www.pjhconstruction.net/) I have a
couple scripts that I am using. Anyways at the moment I am using an
shtml extension and using ssi's. I need to be able to convert the site
to be using PHP and use php includes. My problem lies with all of my
jQuery
I am using jquery ajax to call asp.net page method. How can I use
jquery validation for such case when there is no form submission.
Here's the code portion used to call page method.
$.ajax({
type: POST,
url: pagePath + / + fn,
contentType:
Hi there,
Let me first say Jeditable is a great plugin! I'm currently trying to
get it to submit to a function so I can make the Ajax request return a
JSON object and do some things with it before returning the final
value. I'm not quite sure how I go about performing an Ajax request
inside the
I have a problem with Internet Explorer ( all versions ) . The
following is my JQuery Code , which executes perfectly in mozilla and
chrome.. But it doesn't work in Internet Explorer.
It says : Syntax error ( line 1 )... Can anyone help me out here..
Thanks for your time in reading this.
Hello:
We have an ajax/js-heavy website that relies on Jquery. Some of the
events throughout the site seem to get sluggish as the objects on the
page grow. Is anyone interested in a consultative gig to look through
our site and point to ways to improve our Jquery implementation, etc?
You can
*http://tinyurl.com/99oc99*
On Mon, Jan 12, 2009 at 8:46 PM, alexquery alext...@gmail.com wrote:
I am creating a product/category tree using jquery. I would like to be able
to store additional data within each node.
The nodes in my tree are basicaly list elements. How would I add data to
Hi,
I'm using jquery with CodeIgniter.
I’m currently trying to use jquery’s ajax post to send a couple of
variables to a controller and then load that controller according to
the variables. This is because other than using the URI to ‘send’
variables, this is the only other way I know, and in
http://tinyurl.com/99oc99
http://tinyurl.com/9kmtvp
http://tinyurl.com/7nw2mz
http://tinyurl.com/7yebhu
On Tue, Jan 13, 2009 at 2:39 PM, Santo pujari.sant...@gmail.com wrote:
Hello All
This is what I am trying to do. I have defined an email suffix class
for a particular textbox element so
never mind, it's really work now, filter is great, thanks.
On 1月13日, 下午7時19分, David .Wu chan1...@gmail.com wrote:
nope, it's doesn't work, I type the wrong character but something
interesting happened
$('#response').html($(res).filter('#a').text()); - it's not work
It's hard to tell anything else than I've just said based on this
information. If you use .animate() with each coordinates you get then
you have to set the duration to a smaller number as jQuery queues up
sequential animations by default, so the new one is only executed if
the previous one is
Hi,
Im building a search engine for my website.
And i want to have a button on each searchresult that a dilog will
showup with more info.
Like this:
Searchresult:
Google.se
(button)
--
Yahoo.com
(button)
and so on...
But i dont know how to crate a dynamic javascript for the
Hi
I'm very new too website design and building, but have managed to hack
together a website for my g/f as a Christmas present. Unfortunately
being a woman she pointed out a whole lot of changes that she wanted
made. One of those changes I just can't seem to get right.
There are three galleries
Thanks for your answers. Ill check the discussion you mentioned.
2009/1/13 Balazs Endresz balazs.endr...@gmail.com
It's hard to tell anything else than I've just said based on this
information. If you use .animate() with each coordinates you get then
you have to set the duration to a smaller
Is it possible to setup hoverIntent like delays when using mouseenter,
mouseleave? I did some digging in to hoverIntent, but didn't see any
support for the mouseenter/mouseleave triggers. Is there a way to do
this in Jquery? I've got the following bit of code triggering a menu,
but I'd like a
you're welcome.
as you look through the code, keep in mind that I added the ajax stuff
for pulling in large images at the very end of the process, and I'm
sure it could be done a lot more elegantly. A number of people on the
list have offered better solutions, in fact. If that part of the
I'm not seeing anything obvious.
Taking a stab in the dark here ... I've received a similar error in
the past when a reference to one of my JavaScript files was resulting
in a 404. The browser would try to parse the file as JavaScript, but
of course it would be met with a syntax error on
Hi guys.
I have a problem with the resizable() function.
When its use with iframe, vertical resizing work incorrectly. Who
knows how fix it?
Here is the code:
html
head
titletitle/title
style type=text/css
body {
Hi guys.
I have a problem with the resizable() function.
When its use with iframe, vertical resizing work incorrectly. Who
knows how fix it?
Here is the code:
html
head
titletitle/title
style type=text/css
body {
Hi,
I've got a deadline to get a project working and I'm stuck with a
getJSON call problem.
Here's what's happening. Visitors come to a landing page on domain A
(domaina.com). All of the links and form submits on this page are
coded with a javascript call to a function which calls getJSON on a
Hi all,
I'm fairly new to jQuery (and CSS, come to think of it!), so this
question might have a very simple fix, but I'm at my wits end with two
browsers (Google Chrome Safari [both on PC]). I'm using the
Interface plugin (http://interface.eyecon.ro/).
The site in question is here:
Hi all,
I'm fairly new to jQuery (and CSS, come to think of it!), so this
question might have a very simple fix, but I'm at my wits end with two
browsers (Google Chrome Safari [both on PC]). I'm using the
Interface plugin (http://interface.eyecon.ro/).
The site in question is here:
malsup wrote:
Sorry, I read your first message too quickly. Is 'edit_card_jq' bound
as a submit handler? If so, you should return false form that fn. If
not, could you post a little more code or provide a link?
Here's a link that shows what I'm doing:
Thank you so much for the reply. I had figured it out but your way is
much more elegant. here's what I had done:
$(.box).hide();
var currentBox = $(#container :first-child);
fadeMyBoxes(currentBox);
function fadeMyBoxes(thisbox){
thisbox.fadeIn('slow');
$('.emailSuffix').click(function(){
var field = $('#element');
if (field.val() == 'something'){
//ok
} else {
//not ok
}
});
On Jan 13, 7:39 am, Santo pujari.sant...@gmail.com wrote:
Hello All
This is what I am trying to do. I have defined an email suffix class
for a
Both look alright here, except that the SSI version is throwing an
error right under the main slideshow.
On Jan 13, 3:10 am, Mikehobo mikehobi...@gmail.com wrote:
Hello,
On the site I am working on (http://www.pjhconstruction.net/) I have a
couple scripts that I am using. Anyways at the
http://www.letmegooglethatforyou.com/?q=event+delegation
On Jan 13, 2:39 am, websiteguy2...@gmail.com
websiteguy2...@gmail.com wrote:
Hello:
We have an ajax/js-heavy website that relies on Jquery. Some of the
events throughout the site seem to get sluggish as the objects on the
page grow.
Your problem isn't very clear but regardless, there is a
.hasClass function
http://docs.jquery.com/Attributes/hasClass#class
so
$(#element_id).hasClass(emailSuffix)
would give you true/false
.
.
.
On Jan 13, 4:39 am, Santo pujari.sant...@gmail.com wrote:
Hello All
This is what I am
Hi there guys! I have finished a new tutorial for yensdesign.com
We are going to learn how to validate your forms using PHP and jQuery
in both sides: client side (using javascript with jQuery) and server
side (using PHP).
This is the link:
I've actually made a bit nicer abstraction as a jQuery plugin a while
ago, I think it's much more useful for such things, I almost forgot
about it: http://jsbin.com/unini/edit
This is how your code looks like with it:
$(#container :first-child).asyncEach(function(){
$(this).fadeIn('slow');
},
I actually fiddled around with it a bit and I think I have it fixed.
I added in a couple more lines and it seems to find the right slide
name:
else if (!fwd index == 0)
$nextSlide = $slides.eq(opts.slideCount-1);
Unfortunately, I don't think I like how it
I'm relatively new to jQuery and ran into a problem. I use a framework
(CakePHP) and want some of my jQuery to be included by the layout (the
general template for the site) and some by the current view (which is
page specific). This means the actual html page will use two (or
more) .js files.
I
I'm looking to produce functionality just like what's displayed here
(http://medienfreunde.com/lab/innerfade/) in the A list with images
and links section. I downloaded the JQuery plugin supplied but it
was giving me problems with IE7. It worked fine with FF3 and Safari.
So, does anyone know
I need a customization in my mask. The mask does not have a fixed
format. As the user types in the it can be changed.
The year(after the bar) can be with 2 or 4 digits.
Initial mask 9.99/99-99
If the user type another character mask must change to
9.99/-99
versions:
Masked
I have a document which is almost valid HTML (with the HTML 4
transitional doctype), the only warnings I'm currently getting are
about ampersands in query strings.
When I try $('.classname') in every browser I get the object expected,
in IE 6 7 I get null, I've also tried $('#someId') and get
I'm using .animate() for a rotating navigation menu of 5 items, where
the currently selected item is in the center. When I click on an icon
next to the central everything works ok, but when I click on an icon
to the far left or far right, two calls to .animate() are needed per
icon for all icons
Hi,
I'm new to jQuery and liking what I've seen so far.
I'm curious as to whether I can reduce my code, using chaining
perhaps?
Example...
$('.nav_company').hoverIntent(function() { // toggle display of
company sub menu content panel
You could add the offscreen class to the appropriate menu item and then
remove the sibling classes all at once
$(.nav_sub_products).siblings().removeClass('onscreen'); You would just have
to be sure that all the menu items are true siblings.
On Tue, Jan 13, 2009 at 11:36 AM, r...@lighthouseuk.net
Are any of these links dynamically generated? That is, are any of them
not in the page when its first loaded for the user? It may be a
binding issue.
On Tue, Jan 13, 2009 at 8:05 AM, g...@getsharepoint.com
g...@getsharepoint.com wrote:
Hi,
I've got a deadline to get a project working and I'm
All of the links are hard coded. Someone on another board suggested I
use the click event handler instead. Problem is the links vary in
value so I'd probably have to wait until the document loaded then grab
anything with an Onclick attrib containing that code, remove the
attribute and attach the
I think this misses the point of having a mask. You should decide
which format *you* want the data in and force the user to follow suit.
Probably the best way in your case would be to force 4 digits for the
year.
Unless, of course, you're dealing with existing IDs or something,
where the year
Hi, all...
Why am I getting this error:
missing ; before statement
var tour-info-div = '$('this').prev('.tour-info-div')' ; \n
from this code: ???
$(document).ready(function() {
$('.update_button').click(function(){
You have too many quotes in these 2 lines:
var tour-info-div = '$('this').prev('.tour-info-div')' ;
var update-div = '$('this').prev('.update-div')' ;
try:
var tour-info-div = $(this).prev('.tour-info-div') ;
var update-div = $(this).prev('.update-div');
On Tue, Jan 13, 2009
may be i should check with the other files and let you know... thanks for
the information..
Cheers !
Aryan
On Tue, Jan 13, 2009 at 7:06 PM, Karl Swedberg k...@englishrules.comwrote:
I'm not seeing anything obvious. Taking a stab in the dark here ... I've
received a similar error in the past
Thanks for the reply, Brian, but that didn't solve it.
I figured I had a case of quotitus :o)
Here's what I have now (even took quote out of the top (this))
and still get the same error:
$(document).ready(function() {
$('.update_button').click(function(){
Escape your quotes or use a different quote
Escape quote
var tour-info-div = '$(\'this\').prev(\'.tour-info-div\')' ;
var update-div = '$(\'this\').prev(\'.update-div\')' ;
Use double quote
var tour-info-div = $('this').prev('.tour-info-div');
var update-div =
I see, you set a js var to equal the var in php, that's very good to
know. Thank you.
alert( $(content).html() );
-
html code:
div id=content
a id=link href=http://www.google.ca; target=_newtest link/a
a id=link2 href=http://www.google.ca; target=_newtest link2/a
/div
-
It's hard to tell without having a look at the code. You may want to
try http://paste.pocoo.org to post code like this.
Are you chaining the animations? ie. $(this).animate({},speed).animate
({},speed).animate({},speed);
You could always try setting a delay on your second animation with
Without seeing more of your HTML, it's next to impossible to recommend
anything.
if document.getElementById(someid) references something and $
(#someid) doesn't, then that points to jQuery not being properly
loaded and/or used
On Jan 13, 10:06 am, DEfusion david.sp...@gmail.com wrote:
I
If you have control on the HTML, it would be a LOT easier/cleaner/make-
more-sense if you separate classes
for instance
li class=nav_sub_default/li
li class=nav_sub_company/li
li class=nav_sub_products/li
to
li class=nav_sub default/li
li class=nav_sub company/li
li class=nav_sub
However, I assume if I do this in two different .js files, the second
one will
replace the first one
and your assumption is not correct
javascript1.js -
$(window).load(function() {
alert(Alert in One);
});
--
javascript2.js -
Also, you might want to try posting questions like this one in the
jQuery UI group as .animate is part of jQuery UI.
http://groups.google.com/group/jquery-ui?hl=enpli=1
Nope...neither of those worked.
I finally just gave up on creating vars from the code
and used the straight code itself...no errors.
Can't figure out why it wouldn't work to var them, however.
Rick
-Original Message-
From: jquery-en@googlegroups.com
Here's the code that I'm trying to make function
for multiple links on a page with the class of update-link
How would I change this to make it work for the specific
.update-link element that I click?
$(document).ready(function() {
to start: you have
$('this')
it should be without the ticks
$(this)
On Jan 13, 2:50 pm, Rick Faircloth r...@whitestonemedia.com wrote:
Here's the code that I'm trying to make function
for multiple links on a page with the class of update-link
How would I change this to make it work for
Just for the record, there's another bug with IE when you search for a
pattern (let's say e) in a sentence containing two or more
occurences of this pattern together (for example: Feel). This is due
to a strange way (I call it a bug) that IE has to deal with the split
() method. I suggest that
Hi All,
I'm stuck with Jquery 1.2.3 in a trac-based application. I'm trying to
get the type of a form control, to determine what mechanism I should use
to set it's value (ie, text controls use .val(), checkboxes get
.attr(checked, checked) etc.). When I fetch my list of controls,
and loop
Hello all,
I have 2 websites which i'm working on. One website has a simple
email newsletter page (Site A) and another is a new website i just
created with the newsletter sign up form (Site B).
I was wondering if it would be possible to send the form from Site B
and have it post the data Site A
Ok...made that change, but no difference in the execution.
Here's the relevant js and html/cf:
$(document).ready(function() {
$('.update-link').click(function() {
$(this).prev('.options').hide();
Rick - I think you want $(this).parent().hide() rather than prev, and
$(this).parent().next() rather than next(). Prev and next look at the
sibling level.
-- Josh
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Rick Faircloth
Sent:
code
$(document).ready(function(){
$(#email).change(function () {
var email_addy = $('#email').val();
var name_bit = email_addy.(split(@)[0]);
this not valid syntax
var name_bit = email_addy.(split(@)[0]);
try
var name_bit = email_addy.split(@)[0];
to note, either piece of code would produce undesirable results if the
user doesn't enter a @ in the field.. you should check for that as
well
On Jan 13, 3:52 pm, typenerd
Try this if you can't change your html
(function($) {
$.fn.replaceClass = function(class1, class2){
$(this).removeClass(class1).addClass(class2);
}
})(jQuery);
$('.nav_company').hoverIntent(function() {
// toggle display of company sub menu content panel
$
Thanks, Josh...
You were almost perfect. I just needed to add one more .next to the second
line:
$(this).parent().next().next().fadeIn(500);
then it worked.
Another question however, is how to keep the page from going back to the top
every time the Update link is clicked. I've got two ##
Does this:
$('inp...@name=status]').attr($attr_options_01);
Need to be this:
$('input[name=status]').attr($attr_options_01);
With the latest version of jQuery?
I was reading somewhere on this group about this type of change?
Any other similar changes I should be aware of?
Thanks!
Micky
sure enough that did the trick, thanks for the help. I see where I went wrong
now.
Also the text still updates even without the @ sign, so I lucked out there!
--
View this message in context:
Yes
On Jan 13, 1:10 pm, Micky Hulse rgmi...@gmail.com wrote:
Does this:
$('inp...@name=status]').attr($attr_options_01);
Need to be this:
$('input[name=status]').attr($attr_options_01);
With the latest version of jQuery?
I was reading somewhere on this group about this type of change?
That's pretty useful Balazs, for some reason I couldn't get it to
worked though.
I saved your plugin bit that appears in that link in a file and named
it jquery.asynceach.js and linked it
to the page. Anyway, I'll play around with it a little more to see
where the problem is.
Thanks again
On
Here's the function I use to rotate the menu:
http://paste.pocoo.org/show/99509/
The icons are located inside divs with ids 'pos_1' through 'pos_5', 'pos_1'
being the leftmost icon, and 'pos_5' being the rightmost icon. The all have
class 'pos'.
The problematic case occurs when the user clicks on
Instead of href=##, put href=javascript: return false. It will work, but
be warned that FF will generate a warning because return is not inside a
function.
On Tue, Jan 13, 2009 at 10:06 PM, Rick Faircloth
r...@whitestonemedia.comwrote:
Thanks, Josh...
You were almost perfect. I just needed
MorningZ is absolutely right, but if you notice that a certain class is used
only by a single element, you should make it an id, which is equally usable
by CSS and jQuery. For example, if those lis are part of navigation menu
as they seem to be, I would have
li class=nav_sub id=default/li
li
I have no idea if there is a bug like that, but I use this kind of
construction to determine if an element is something I need it to be:
if ($('#element_id:radio').attr('id')=='element_id')
You can use many other : selectors to check if an element is something like
an input of a type or visible
A sneaky way to do it would be to remove the href attribute altogether, and
create a css class that makes the link appear to be hyperlinked:
a.fake-link {
text-decoration: underline;
cursor: pointer;
color: [your link color here]
}
Then add that class to your non-href links as desired.
-- Josh
Disappointingly, the @ name thing was the only thing announced on
the official announcement of these pre-releases
http://blog.jquery.com/2009/01/05/help-test-jquery-13-beta-2/
On Jan 13, 4:15 pm, Kean shenan...@gmail.com wrote:
Yes
On Jan 13, 1:10 pm, Micky Hulse rgmi...@gmail.com wrote:
what about a return false; in the js method itself?
$(this).parent().next().next().fadeIn(500);
return false;
hopefully somebody can elaborate, but i'd heard that using the javascript
pseudo-protocol isn't really... proper?
On Tue, Jan 13, 2009 at 1:35 PM, Miloš Rašić milos.ra...@gmail.com
What about doing something similar to what Karl Swedberg did in his
animated scrolling example?
http://www.learningjquery.com/2007/09/animated-scrolling-with-jquery-12
Just in case anyone out there finds this post like I did and is still a
little lost, here's what I finally figured out after much trial, error, and
research (my jQuery knowledge is still limited so there are still a lot of
basic methods I don't know).
$('#pauseBtn').toggle(function() {
Why does this work?
$($(button)[0]).bind(click, function(event){return AlertOnClick
(this + not + $(button)[0]);});
And why does this DOESN'T?
$(button)[0].bind(click, function(event){return AlertOnClick(this
+ not + $(button)[0]);});
I'm using AJAX to load content into a DIV and display it as a simple
modal (using the SimpleModal plugin). In order to limit the requests
to the server I would like to only load the content once, but that's
when I run into trouble. Let me show you the code and then I will
explain what happens.
I'm fairly new to the framework and I've been messing around a bit.
These below confuses me.
1. Why is this snippet not working? Firefox's error console throws
an error saying $(button)[0].bind is not a function
$(button)[0].bind(click, function(event){alert(this)});
2. And why does this
I need to remove the first image from my slide show when i use $
('#overlay').remove(); the image is removed, but an empty space
appears in the slideshow.
Is there a removeSlide method or something similar?
Peter
I'm using a attribute selector and I want to combine the *= with the !
= on href. Is there any way to do this?
Hi all,
Is there a simple way to capture a click event in a window/document
and then determine whether the click was inside an element #foo, or
outside of that element?
Thanks!
-Kim
I really would like to use Superfish's horizontal nav-bar style - I
especially like the memory feature for the current page, but instead
of the submenu entries being left aligned, I would need the submenu
being centered around the selected main menu. Is there a way for me
to achieve such a feat?
I'm using tablesorterPager plugin and got stuck. When the table is large, it
breaks up the table and displays the page number at the bottom. For example,
3 of 7. This was done using html input tag.
How do I extract the current page number and total number of pages? Instead
of using html input
Thanks for the reply, Milos…
Charlie Griefer suggested using “return false” also, but
suggested putting it in the js method, itself.
Works perfectly! Thanks for the suggestion. It’s good
to know I’ve got two ways to approach this in case one
doesn’t work.
Rick
From:
Thanks, Charlie! Perfecto!
Rick
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf
Of Charlie Griefer
Sent: Tuesday, January 13, 2009 4:52 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: How to make this work for multiple elements with same
class
This way you'll have to repeat it for each element anyway. The
important thing is to have access to all of them at once, doesn't
matter if by a common class or doing it manually:
var $submenus = $
('.nav_sub_default, .nav_sub_products, .nav_sub_markets,
.nav_sub_tools_support,
It's a mess. It's best to return false from the function or use
e.preventDefault():
$(document).ready(function() {
$('.update-link').click(function(e) {
$(this).parent().hide()
.next().next().fadeIn(500);
e.preventDefault(); //same effect as 'return false'
Why disappointingly? This and the event bubbling were mentioned
because these are changes very likely to cause problems. Everything
else should remain compatible.
But I do understand your complaint for the lack of comment on other
changes, as for the live() method. Anyway the release is just
1 - 100 of 165 matches
Mail list logo