Hi Rey,
There isn't much to optimise in my opinion. But you can make maintenance easier.
you could start by
1./ storing $(this) into a variable: var $this = $(this). Same for
$(this).val() since you use it several times. var myVal =
$(this).val();
2./ change selectors:
$(select#cert_id)
Thanks Karl,
That makes complete sense! I've tried to implement it by replacing all
of the instances where I'm referring to p elements to refer to all
direct child elements of the #article div, but am not getting an
error in JQuery - http://brian-talbot.com/inventingroom/jquery-expand/
Node
Hi Rey,
I agree with Alexandre that there isn't a whole lot to do, but that
caching $(this) and any other jQuery object used multiple times is a
good idea.
One minor correction regarding this:
Indicating the tag makes jquery look for the tags first, then the id
in the bunch of select
Thanks Alexandre. I just wanted to do a sanity check on the code
structure itself in case there was a better way to build it.
The suggestions for minimizing the function calls makes sense and I'll
do that.
Thanks for your help! :)
Rey
Alexandre Plennevaux wrote:
Hi Rey,
There isn't
Great suggestions Karl! Thanks for the help. :)
Feels good to be back on the horse. ;)
Rey...
Karl Swedberg wrote:
Hi Rey,
I agree with Alexandre that there isn't a whole lot to do, but that
caching $(this) and any other jQuery object used multiple times is a
good idea.
One minor
Hey all,
I found a solution to my issue. All I needed to do was traverse the
DOM a bit within my .click function. For those of you interested/
having the same issues, here's the solution -
http://brian-talbot.com/inventingroom/flagcomments2/
-- Brian
On Apr 14, 5:43 pm, Brian Talbot [EMAIL
Hi Brian,
Looks like the problem is caused by these 2 lines:
// insert a wrapper div after the 3rd
paragraph (and hide it)
var $xwrapper = $('div class=article-container/
div').insertAfter('#article *:eq(2)').hide();
Thanks Karl,
That did the trick! I've learned my lesson - keep track of the
elements I insert into the DOM! :o)
-- Brian
On Apr 15, 12:20 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
Hi Brian,
Looks like the problem is caused by these 2 lines:
//
Hello Michael,
this works for me:
$(document).ready(function() {
$(input[name='spellQ']).bind(change,function() {
if($(this).attr(value) == 'Y') {
$(input[name='playerName-0']).val($(.correctWord).html());
} else {
alert('User selected NO');
Thanks for the help Joel...got it now.
I use jquery.form plugin to submit a form , but the ajaxSuccess()
function not run, other function run exacitly , how can i let jquery
knows it run success
Codes:
function submitImageUploadForm(){
// 显示 loading 图片
$(#loading)
.ajaxStart(function(){
Hello,
Perhaps I am doing something wrong, however, I tried using your
default menu with default styling and it worked great (looks great
too).
Then i turned off CSS to see how it would degrade and the menus did
not work at all. I was under the impression that superfish hooked up
to a
does anyone know how to fix this choppy animate Firefox bug? Is this
normal jquery animate behavior?
In safari it looks very smooth.
(be sure to hover over the 3 images from left to right, you will
notice it jumping from time to time)
http://mindimpulse.com/choppy/
Hello,
This may be a double post, kept waiting for my post more than 30
minutes to show up, but so far it is a no show.
I was looking at superfish, and wanted to see how it was working
without javascript. Now I may be misunderstanding how it is working,
or suppose to work, but from what I
Hi i'm having trouble selecting items that are next to each oterh and
would love some help
The first issue is a dynamic table with a remove row link in the
last column
For each row in the table i want to add an onclick event to the
remove row link, that refers to some information contained in
For my freelance business I love jQuery and the excellent Cycle
plugin. But at the day job we're married to prototype/script.aculo.us
(and don't want to load 2 js libraries).
Just thought I'd ask around here if anyone knows of something for
prototype/scriptaculous that is as awesome as Cycle...
HI *,
is there a way to know when a pdf embedded document is loaded?
I've tried the following solution with no successfully results
iframe id=stampa src=/foo.pdf
/iframe
script language=javascript type=text/javascript
var stampa = document.getElementById('stampa');
div class='item'
div class='img_cont'
div class='item_info'264 VIEWS/div
img tag is in here
/div
/div
I have a situation where I have to use prototype/scriptaculous and not
jquery =(
I've been trying to find something similar to the jquery Cycle plugin
for prototype/scriptaculous, but haven't found anything close to it.
I've been so spoiled by jQuery and Cycle... anyone know of anything
remotely
Hi,
I had the same problem and I solve it writing my own function to
convert rgb values to hex:
//Function to get hex format a rgb colour
function rgb2hex(rgb) {
//generates the hex-digits for a colour.
function hex(x) {
I'm having a hard time serializing my DOM,
serializeArray seems to just store :input value attributes,
I'm trying to push other attributes on a json variable, but I can't
seem to find anything like php's array_push and such.
James
Hi Mike,
Sorry its taken a while to get back to you.
My version of IE6 does work with your demo pages.
This is my CSS for s1:
#s1 { /* image cycle used on index.php */
width: 250px;
height: 300px;
float:right;
}
I'm still having problems upload ing to my testing server so I've
pasted in my
Hello,
For the dynamic form in the validation plugin, can I use any other
element other than the text area. For my needs the dynamic content
includes a text area. I have tried tfoot, div, span, fieldsets with no
avail.
Thanks in advance
Stephen
Hi every Body :
I 'm a java developer and i find that the jQuery is an amazing
javascript library and very powerful
but i have a noticed that in selecting controls you select usint
the id tag
but i struts framework we don't use id tag instead we use property
tag if struts forms ;
so i
I am using Ajax form posting.
var options = {
dataType: 'xml',
beforeSubmit: post_request,
success: response_xml
};
$(#form).submit(function() {
$(this).ajaxSubmit(options);
// !!! Important !!!
// always return false to prevent standard browser submit
Hi,
I've been trying to change the content of an element using html(),
however I want to fade the element out before I change the contents.
sample code:
$(document).ready(function(){
$(#menu li).click(function(){
My testing server is now working again. Yay!
You can view the problem page at:
http://www.admgroup.entadsl.com/bg_bags/index.php
Thanks
Kirsty
On Apr 11, 5:23 pm, Mike Alsup [EMAIL PROTECTED] wrote:
Unfortunately, I am having problems with my server at the moment so I
could only test
Hi Mika,
Did you have any thoughts on what might be caugsing the conflict?
Regards,
Steve
On Apr 8, 8:43 pm, Mika Tuupola [EMAIL PROTECTED] wrote:
On Apr 8, 2008, at 8:55 PM, [EMAIL PROTECTED] wrote:
Thanks, but I think you missed the problem. 'Editable item' does work,
but 'Editable
The problem with sortable is that if i bind a list element with it, no
click event fires for that element or any of its sub-elements. Given
below is the source code. if i comment the sortable line the click
event will work fine. Any solution for this problem champs?
ul id=testUL
Hi,
I'm currently using JQuery with innerfade to create a slideshow
feature on a website I am developing,
Each image has information regarding the copyright of the
photographer. Unfortunately it seems that JQuery is adding amp;
instead of the original therefore I am unable to get the HTML
Hi,
I am writing an app that uses both jquery and regular javascript (is
this bad?).
I have two groups of jquery tabs, each with form fields in them.
I want a select list to trigger a specific tab if the value slected =
2;
Can you trigger jquery events from other javascript functions? If so,
Thank you Karl - worked like a charm!
What a great surprise to see the author of two great jQuery books,
'jQuery Reference Guide' and 'Learning jQuery' to be the respondent.
Thank you Karl - worked like a charm
On Apr 13, 1:13 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
Hi there,
Probably the easiest way -- provided that the group of inputs is
always contained within a paragraph -- is to do this:
$(this).parents('p').find('input.required.spell').val(newText);
Thats good to know.
I will have look at the code and add some semicolons.
Please let me know if you have any luck with Safari 2.x
Cheers.
On Apr 9, 2:49 pm, dibeja [EMAIL PROTECTED] wrote:
Safari is pretty uncomfortable with javascript without semicolons at
the right places.
I've added a
I'm still experiencing issues with the Image map;
http://legacyvillage.optiemstaging.com/Directory/
I've updated my .js files, also updated my script to include the map
area code.
No love.
Any help would be greatly appreciated.
-C
On Mar 26, 3:54 pm, Jörn Zaefferer [EMAIL PROTECTED]
The problem wasn't issues with colspans. It was an interesting
behavior with table widths that I hadn't seen documented before. If
you adjust the widths of a table cell, the overall width of the table
will increase accordingly. That is, until it hits the width of the
page. At that point, the
Hi Jörn,
On Apr 13, 1:01 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
Bryce Lohr schrieb: Hi Jörn,
Validating a subsection of a larger form:
http://www.gearheadsoftware.com/subsect-112.html
http://www.gearheadsoftware.com/subsect-121.html
You can solve that by setting up validation only
I've got a form with jquery and regular javascript mixed (is this bad?),
along with 2 groups of jquery tabs with form fields within them.
I am trying to get a select list to activate a particular tab.
Here is what I have so far.
$('#hispeed_type').change(function(event) {
Ok.
I think the best way to explain this will be by an example. This is
pseudo code to a degree.
$.each(data, function(i,item){
myFunction()
});
Now.
'data' is from a json call. this works.
'myFunction' does all sorts of stuff. It adds an li, then populates it
with a bunch of stuff
Hi Rob,
I finally found the cause and a solution :)
Cause: asp:GridView loses the 'thead' section on postback and
reverts to the default (header row in 'tbody'), and tablesorter
expects 'thead'.
I tried different WebForms tricks to get it to keep 'thead', but got
tired before I succeeded.
I
I'm trying to access all objects with a given color, but I can't
figure out how to get objects by :hover color. I'm using this code:
$(document).ready(function() {
$('*').each(function() {
var fg = $(this).css('color');
// do something with $(this)
Hi i am trying to use the innerfade pager transition example and I
can't seem to get it to work. I know that i need add a function for
the pager transition to work, but I have no clue on how to go about
writing one.
Any pointers would be much appropriated!
On Mar 10, 12:40 pm, jerpod [EMAIL
Hi, I am new to JQuery and Ajax so I am not sure which direction to go
to find what I am looking for. A plugin or tutorial would be great.
I want to be able to load 25 items (thumbs) at a time and hit a button
(Next) to load another 25 in the same div on demand.
Also, what are the limitations
Hi Rob,
I finally found the cause and a solution :)
Cause: asp:GridView loses the 'thead' section on postback and
reverts to the default (header row in 'tbody'), and tablesorter
expects 'thead'.
I tried different WebForms tricks to get it to keep 'thead', but got
tired before I succeeded.
I
I just noticed that the updated version 1.4 of jdMenu no longer makes
use of the bgiframe plugin to cover the select bug in IE6
What's the most efficient workaround?
do I bind bgiframe to the ul.jdmenu ul.sub?
thanks,
rolfsf
Hello,
My page includes jquery.js in the header.
In the body I have a script tag that loads a widget.js file that
contains
document.write('script type=text/javascript src=/js/jquery.js/
script');
jQuery.noConflict();
The problem is that I'm losing all plugins loaded before the
document.write
Hi,
i'm using jquery plugin to validate my form.
I have two questions.
1. Why does deleguate.js is required and what is it doing ?
2. I have a form with a list like this one :
select id=imputemail name=imputemail class=required
option selected=selectedSelect from this list/option
Hi,
I am trying to retrieve JSON Data from a remote server and manipulate
teh returned data. That all works fine - the callback is executed and
it all works as expected. The issue I am running into is that I want
to use timeouts and error messages also - and they are not working.
I tried the
Hello,
Since the console is buggy for Windows, I cannot enter absolute paths
for the app, I want to execute the command for ACL so that ACL tables
are built.
I've wasted a lot of time in this simple thing, can someone please
help me and export the structure of ACL tables in SQL format for me?
it says Submitting a form with AJAX doesn't get any easier than this at this
address:
http://malsup.com/jquery/form/#
I am unable to get a simple form submitted to the sever. Making the forms is
not the problem,
however, it says i may need the plug in jquery.form.js so i uploaded it to
my
Hi folks
I'm loving Superfish to bits - I have very little knowledge of js but
I've managed to make a vertical drop-down menu which has the drop-
downs animate-in very easily.
What I'm now trying to do is to get the drop-downs to animate-out on a
mouseout. This is beyond the basic tutorial
Hey, there's a plugin on jquery that handles that resizing and horizontal
scrolling:
http://plugins.jquery.com/project/jscrollhorizontalpane
cheers
tr
Hk.-2 wrote:
Hello,
I have just found this nice little piece of JS while I was looking for
a nice script to replace this cruel
Hey, there's a jquery plugin here:
http://plugins.jquery.com/project/jscrollhorizontalpane
should do what you need
cheers
On Mar 13, 3:29 pm, Trend-King [EMAIL PROTECTED] wrote:
is there a way to use jscrollpane (this exelent plugin) the
horizontally way?
please help me
greet jens from
Ok.
I think the best way to explain this will be by an example. This is
pseudo code to a degree.
$.each(data, function(i,item){
myFunction()
});
Now.
'data' is from a json call. this works.
'myFunction' does all sorts of stuff. It adds an li, then populates it
with a bunch of stuff
Hi,
I've tried a million workarounds for this, but it just doesn't seem to
work in Firefox! I fire up a jqModal login box which is calling a
separate html page, which connects to a php login script, and if
success, the php returns a success message in the Modal and reloads
the parent page, i.e.
input id=number name=user.number
title=Please enter a number with at
least 3 and max 15
characters! /
Using validation rules on this field
rules: {
number: {
required:true,
Hi,
Our site is mainly a jQuery shop, with lots of JavaScript goodness:
http://www.freeidentityprotect.com.
We're using a number of plugins including the newer UI (dialog
accordion), Enchant, SimpleModal, Form, Validation, Dimensions and
some homebrew. I've noticed load time is a little slow
Ok.
I think the best way to explain this will be by an example. This is
pseudo code to a degree.
$.each(data, function(i,item){
myFunction()
});
Now.
'data' is from a json call. this works.
'myFunction' does all sorts of stuff. It adds an li, then populates it
with a bunch of stuff
Hello jsandppr
If you clear your css at the end of your html page then the back
button should work fine.
I just add a br style=clear:both; before my /body and /html
tags.
This seems to work.
Cheers!
Yush
On Apr 1, 8:57 am, jsandppr [EMAIL PROTECTED] wrote:
Hi, all
I've used jQuery to
Ok, so I have a CMS, and it uses Superfish for (most, not all) of the
navigation. Every so often (on specific actions by admin) the inner
structure of the navigation is tossed about. With superfish enabled,
it breaks my navigation, and I can only get to the top level items,
anything hidden in a
Hi, I am trying to bind Ajax click event handlers to links that I have
dynamically
appended to the DOM tree.
Basically I have:
var html = 'trtda href=someurltext/a/td/tr'
$(#table tbody).append(html);
If I try to add click handlers to these anchor tags, they don't work.
NB: Apologies if you're receiving this question second time, my
earlier post doesn't show up even after 3 hours
Hi,
I've tried a million workarounds for this, but it just doesn't seem to
work in Firefox! I fire up a jqModal login box which is calling a
separate html page, which connects to a
Is this possible to do? I only found how to make it on a left side but
I need it very much at bottom.
Please, help.
Alex
Hi
Is there something wrong with my membership settings ?
Non of my questions have made it to the list yet.
Regards, Louis.
No worries, Karl. I know you're a busy guy. Your help
when and if you get a chance is greatly appreciated.
az
On Apr 13, 4:52 am, Karl Swedberg [EMAIL PROTECTED] wrote:
hi again az,
sorry, I've been terribly busy, but I'll try to take a look later on
today.
--Karl
_
Hey guys,
One of my scripts doesn't work in IE but I've managed to find the
offending code, not thanks to IE...
var dave = $(a:not(a[onClick*=pageTracker._trackPageview])[href
$=.pdf], [href$=.rtf], [href$=.ppt], [href$=.txt], [href$=.mp3], [href
$=.xml], [href$=.exe], [href$=.zip],
Is it possible that jQuery would insert tbody tags into the DOM for
tables that do not have them?
I am beginning to suspect that jQuery is the reason these tbody tags
are appearing in the rendered source of my pages, despite the tables
not having tbody tags in my code.
/alex
Hopefully this one makes it, my posts don't seem to be showing up.
I was looking at superfish, and wanted to see how it was working
without javascript. Now I may be misunderstanding how it is working,
or suppose to work, but from what I read, superfish should sit on top
of suckerfish, enhancing
Hi, I need to make input type=text auto-grow when there's more
text that can fit in it..
I was unable to find any plugin for this, found only for textarea
(http://www.aclevercookie.com/demos/autogrow_textarea.html)
Anyone saw something similar for input type=text ?
I have been using the jquery for a long time now.. then I've decided
to at least write a simple Ajax class of my own as a part of learning,
and as I'm waiting for John's new coming book(I read somewhere on the
forum from his site that it will teach you how to write your own
library...) .
I just
It looks like what you're doing is setting a variable for all of the
comments when the page is loaded, and reusing that variable when you
want to show the Flag comment section.
Instead, you'd want to only handle the comment that the user clicked
on by using the parent() function available in
**If this post is a duplicate, I apologize; I never saw the first one
I wrote a day or two ago appear on the list or in search results.
Hi Jörn,
On Apr 13, 1:01 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
$(function() {
// Rules just for the Financial Info subsection
Right now I've too much work so I can't give support to iconDock.
So thank you Wizzud for your good job, also for the mention on the
sourcecode. ;)
Best regards,
Isaac Roca
On 1 Abr, 00:16, Wizzud [EMAIL PROTECTED] wrote:
I should have stated initially that this was simply a rewrite (and
Hi,
I got something like this: http://ischagast.nl/serialscroll/
What I want is to get the item index after the title directly, what I
got right now it that you see that index after clicking the li.
$('body.domenabled #item_news ul li').click(function () {
var index = $('body.domenabled
Dear All,
I have written the following code, which slides the div #menu away
from view 'below' the browser window.
The first part, triggered by #hidemenu, works perfectly. However, the
second part, triggered by #showmenu, has no effect at all?!
I need the div #menu to be restored back to its
So I have two text fields in a form I've created which will constitute a date
range. I want to use the datepicker(change, settings) function to change the
min or max date of the field when a date is selected.
Example:
User selects: 4/10/2008 in 'from' datepicker. onSelect should then
I currently have code that can iterate through a group of div's to act
as a slideshow. What I am trying to do is have multiple groups of
div's with the same class be on the same page and have each slideshow
act independently of the other. Can someone please take a look at this
code and provide
I'm a tentative switcher from Prototype. Not sure yet... I'm porting
one app to see how it suits me. One of the frequent things this app
does is work with text in a textarea. Let's say the id of the textarea
is inputbox ... I find myself writing code like:
$('#inputbox')[0].value =
I had this exact issue once. It was extremely easy to resolve too. What I did
was incorporate a click event for that tab into the message list of the
validator.
messages: {
Fieldname: {
required: function(){$(child link of relevant tab
here).click();return;}
}
Hi,
I am trying to retrieve JSON Data from a remote server and manipulate
teh returned data. That all works fine - the callback is executed and
it all works as expected. The issue I am running into is that I want
to use timeouts and error messages also - and they are not working.
I tried the
I know I've already asked this before -- and, well, it may not even be
possible, but, here goes again. Is it possible to copy from one
combobox to another one; such as address information. After COMBING
the web, I FINALLY found an example here:
I have had an opportunity to use this approach Ariel on a small
component, and it really works very well. To me it seems much nicer
than the dual constructor approach that seems to be the defacto
standard. Thanks for sharing.
-- jim
No, I don't think there is. When you use JSONP or other script-tag
techniques, jQuery creates the script tag DOM element, but I don't think it
can get any response if the script fails to load. Whatever happens, happens.
It's technically possible to simulate a timeout by wrapping the JSONP
Glad it helped ;)
http://yuiblog.com/blog/2007/01/17/event-plan/
Cheers
--
Ariel Flesler
http://flesler.blogspot.com
On 15 abr, 16:30, oravecz [EMAIL PROTECTED] wrote:
I have had an opportunity to use this approach Ariel on a small
component, and it really works very well. To me it seems
On Apr 14, 2008, at 1:34 PM, [EMAIL PROTECTED] wrote:
I'm sorry I haven't had time to look deep into it.
Did you have any thoughts on what might be caugsing the conflict?
Thanks, but I think you missed the problem. 'Editable item' does
work,
but 'Editable tab 3' doesn't. The reason I
I have this script:
http://ts.7079.net/ischema/addBlock.cfm
I've been playing with it for quite some time and cannot figure out
how to get it working right. When you click the Add Query button, it
should give you a block that will allow you to add individual rows
within them. The only Add Join
On Apr 14, 2008, at 4:13 AM, Iminay wrote:
sample code:
$(document).ready(function(){
$(#menu li).click(function(){
$(this).fadeTo(1000,0).html(changed).fadeTo(1000,1);
});
});
$(document).ready(function(){
$(#menu
If I understood it correct I have a jQuery snippet where I did a Same
as Shipping address kind of thing.
code
script
$(document).ready(function(){
function same_billing() {
var thisCheck = $(this);
var owner_address = $(#owner_address).val();
var
Hello All,
Implemented suggest to my site and it's working fine the only
problem I experienced is that I could not find an easy way (like pre-
set definition) to automatically submit the form when the user select
a suggestion.
Am I missing something or the only option would be to assign id to
Please ignore the fact that the single quotes are being escaped.
Thanks
Donald wrote:
Is i possible to pass arguments to callback functions right now I
have:
$(.imagethumb).each(function() {
$(this).bind( \'click\', function() {
var $id = $(this)[0].id;
Is i possible to pass arguments to callback functions right now I
have:
$(.imagethumb).each(function() {
$(this).bind( \'click\', function() {
var $id = $(this)[0].id;
$(#prodimage).fadeOut(slow,
function($id) {
$(#prodimage)[0].src = $(# + id
Hi Dennis,
Yes, use the callback function.
$(document).ready(function(){
$(#menu li).click(function(){
$(this).fadeTo(1000, 0, function() {
$(this).html(changed).fadeTo(1000,1);
});
});
});
--Karl
_
Karl Swedberg
What version of tabs do you use?
--Klaus
On Apr 14, 8:05 pm, Mike Volmar [EMAIL PROTECTED] wrote:
I've got a form with jquery and regular javascript mixed (is this bad?),
along with 2 groups of jquery tabs with form fields within them.
I am trying to get a select list to activate a
You could do something like this (needs a bit of tweaking):
html
head
script
type=text/javascript
src=http://cachefile.net/scripts/jquery/1.2.3/
jquery-1.2.3.min.js
/script
script
matt schrieb:
input id=number name=user.number
title=Please enter a number with at
least 3 and max 15
characters! /
Using validation rules on this field
rules: {
number: {
rsavard schrieb:
Hi,
i'm using jquery plugin to validate my form.
I have two questions.
1. Why does deleguate.js is required and what is it doing ?
2. I have a form with a list like this one :
select id=imputemail name=imputemail class=required
option selected=selectedSelect from this
Hi Mike,
In case someone else wants to see the solution I sent you in reply to
the personal email, here it is:
triggerTab is not a jQuery core function. It's probably part of the
Tabs plugin.
Do you have a .click() handler already attached to links inside of
#containerA? If so, you
You can use the val() function:
$('#inputbox').val( json['results'] );
http://docs.jquery.com/Attributes/val
There's probably a minor slow down since it's using a function rather
than direct assignment.
Karl Rudd
On Wed, Apr 16, 2008 at 3:34 AM, s.ross [EMAIL PROTECTED] wrote:
I'm a
Hi Jimmy,
One suggestion that has been offered here before for getting multiple
plugin files concatenated nicely is to prepend each plugin file with a
semicolon.
Hope that helps.
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Apr 14, 2008, at
Hi there,
We have lots of resources to help you with your problem:
Three plugins:
LiveQuery:
http://jquery.com/plugins/project/livequery/
Listen:
http://flesler.blogspot.com/2007/10/jquerylisten.html
Intercept:
http://plugins.jquery.com/project/Intercept
A Frequently Asked Questions page:
1 - 100 of 103 matches
Mail list logo