Thanks a lot,
i've also implemented the $(document).ready part!
Thanks a lot guys!!
On Jan 14, 7:41 pm, JT j...@terenz.io wrote:
I think this might work for you:
(function($){
$.fn.extend({
initSlides: function(){
var t = $(this).attr(id);
$(# + t +
Darn, you are so right! Of course it makes sense
once you know it. Thanks a lot!!
On Jan 14, 10:01 am, Gus Waddell guswadd...@gmail.com wrote:
Hi Knal,
You need to have the function available before you try and call it. Try
putting the $.fn.extend at the top of your script...
--
I think this might work for you:
(function($){
$.fn.extend({
initSlides: function(){
var t = $(this).attr(id);
$(# + t + img).hide();
}
});
$(document).ready(function(){
if (!$(div.introbody).length) {
$('#new').live('click', function() {
addRecord($(this).closest(form).attr(id));
});
function addRecord(form_id) {
.. stuff ...
});
On Jan 12, 1:59 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
I have this function:
[ ... ]
So it works fine but I have this in 5 pages on the site and was wondering
how can I turn this into a standard function and call it like:
addRecord(form_id);
There are several ways to
;
});
}
But no alert. Any ideas?
Thanks
Dave
-Original Message-
From: MorningZ [mailto:morni...@gmail.com]
Sent: January-12-10 3:53 PM
To: jQuery (English)
Subject: [jQuery] Re: Function help
$('#new').live('click', function() {
addRecord($(this).closest
function slide() {
if ($(slide_img).attr(src)!=images/1.jpg){
$(slide_img).fadeOut(200,function() {
$(slide_img).attr({src:images/1.jpg});
$(slide_img).fadeIn(200);
});}
}
OR
use can use this like:
function
I tried again with this reference, and now with
settings.originalCall.myFunction() I received that the function is not
a function :-\
may want to try the correct syntax for each
$.each($items, function() {
totalit(this);
});
also, just to point out, usually best practice points out to use $
at the beginning of variable names for jQuery objects surely works
otherwise, but your style is slightly confusing
On Nov 26,
In the second argument to .animate() you can specify a step callback, like
so
$(#myDiv).width(100);
$(#myDiv).animate({ width: 500px }, {
duration: 500,
step: function(val, opt) {
console.log(val, opt)
}
});
The val in above will go from 100 to 500, and opt will contain among others,
a
Thank you so much, this is just what I needed :)
Ramon
On 7 oct, 19:40, Richard D. Worth rdwo...@gmail.com wrote:
In the second argument to .animate() you can specify a step callback, like
so
$(#myDiv).width(100);
$(#myDiv).animate({ width: 500px }, {
duration: 500,
step:
Hi Julio,
The .gt() and .lt() methods were deprecated (http://docs.jquery.com/Release:jQuery_1.2#DOM_Traversing
) and subsequently removed from jQuery quite a while ago. In their
place, you can use the .slice() method:
http://docs.jquery.com/Traversing/slice#startend
--Karl
2009/7/29 marksimon zen...@gmail.com:
Any idea why this would run twice:
function clickcharges() {
$('#cardcharges tr td').click(function() {
alert('execute once');
});
}
Stupid idea, but maybe... Because the td tag is part of the tr. And if
you click the cell once
no stupid ideas here, but changing to $(#cardcharges td).click( didn't
fix the problem.
On Jul 29, 11:22 am, András Csányi sayusi.a...@gmail.com wrote:
2009/7/29 marksimon zen...@gmail.com:
Any idea why this would run twice:
function clickcharges() {
$('#cardcharges tr
Pretty sure its because the event is bubbling up. Try:
$('#cardcharges td').click(function(){
alert('execute once');
return false;
});
On Jul 29, 2:38 pm, marksimon zen...@gmail.com wrote:
no stupid ideas here, but changing to $(#cardcharges td).click( didn't
fix the problem.
On Jul 29,
Still getting 2 alerts.
On Jul 29, 11:49 am, Eric Garside gars...@gmail.com wrote:
Pretty sure its because the event is bubbling up. Try:
$('#cardcharges td').click(function(){
alert('execute once');
return false;
});
On Jul 29, 2:38 pm, marksimon zen...@gmail.com wrote:
no stupid
How many times is clickcharges called? Perhaps you're binding a click more
than once.
--John
On Wed, Jul 29, 2009 at 3:03 PM, marksimon zen...@gmail.com wrote:
Still getting 2 alerts.
On Jul 29, 11:49 am, Eric Garside gars...@gmail.com wrote:
Pretty sure its because the event is bubbling
On Wed, Jul 29, 2009 at 3:03 PM, marksimonzen...@gmail.com wrote:
Still getting 2 alerts.
You show your .click() function in another...is that wrapping function
getting called more than once? If so, the action is getting bound
more than once.
--
Brett Ritter / SwiftOne
swift...@swiftone.org
Got it. Thanks all. I was calling it twice. Fixed that and it's fine
now.
On Jul 29, 12:12 pm, Brett Ritter swift...@swiftone.org wrote:
On Wed, Jul 29, 2009 at 3:03 PM, marksimonzen...@gmail.com wrote:
Still getting 2 alerts.
You show your .click() function in another...is that wrapping
there are a bunch of plugins like this , just search for wait, pause,
or delay and you should find one that is much more complete then your
code you have.
On Jul 10, 11:34 am, Many martin.clav...@gmail.com wrote:
Why not a plugin like (small correction void should be a string)
$.fn.delay =
On Jul 7, 11:04 am, Josh Nathanson joshnathan...@gmail.com wrote:
You can't.
Of course you can.
You'll have to create a global variable outside document.ready:
var myFuncs = {};
Or just:
var foo;
or from within the ready function:
var global = (function(){return this;})();
http://plugins.jquery.com/project/parseQuery
Perfect, thank you!
You can't. You'll have to create a global variable outside document.ready:
var myFuncs = {};
$(document).ready(function() {
myFuncs.foo = function() {
// etc.
};
});
other .js file:
myFuncs.foo();
-- Josh
-Original Message-
From: jquery-en@googlegroups.com
http://plugins.jquery.com/project/parseQuery
(minified it's 449 bytes
http://plugins.jquery.com/files/jquery.parsequery.min_.js_.txt)
On Jul 5, 1:41 pm, candlerb b.cand...@pobox.com wrote:
Hello, a quick question in case I'm being stupid :-)
I see that jQuery provides a function to turn
"The only thing I can attribute to this not working is the fact that
the form is loaded after the document is technically 'ready'."
That is it exactly, there is a live() function in jquery with limited
event handling as well as livequery plugin that binds events to future
data
transpar3nt
Hi, Keith...
I'm not sure what the final solution will be for your particular issue,
especially since
your are using home-grown ajax, but I will say that I deal with
DOM-injected code
all the time by using the livequery plug-in available for jQuery. It's
designed for just
this purpose...to apply
I would imagine that this fixes your problem:
$(document).ready(function(){
$(#showwhat).change( function(){
onSelectChange(#showwhat));
});
});
But I'm not sure that this is the best way to approach this particular
problem. Try the code found here:
http://jsbin.com/udamo
How about something like this
$(document).ready(function(){
$(#showwhat).change(function() { show_output( $(this).val
() ); });
function show_output(selected) {
var output = ;
if(selected == Tomorrow) output =
If you really must pass the select object then try something like this
$(document).ready(function(){
$(#showwhat).change(function() { show_output( $(this) ); });
function show_output(my_select) {
var selected = my_select.val() ;
var output =
Everytime you're calling that function, you're adding an addition
click event to it. One option is to unbind any existing onclick events
and then re-bind it.:
$('a[rel=lesson]').unbind('click').click(...)
On Mar 4, 5:42 am, inertiahz p.thripple...@googlemail.com wrote:
Hi there,
Just getting
Another option is to use the live() function.:
$('a[rel=lesson]').live('click', function() {
window.open(this.href, _blank, channelmode=0, directories=0,
fullscreen=0, height=820, left=0, location=0, menubar=0, resizeable=1,
scrollbars=0, status=1, titlebar=1, toolbar=0, top=0, width=1044);
The issue here is that AJAX is asynchronous. The the moment you're
checking pnrexists(ph), it'll execute the AJAX but nothing is returned
at that moment (which means it is not-true, so the if-statement
fails). Then a few milliseconds later, your AJAX response has
returned, but the code is way
Hello!
Thanks you your answer, but it seems like it didnt help!
function pnrexists(a){
$.ajax({
async: true,
url: '/inc/chkusr.php?q=p',
type: 'POST',
dataType: 'html',
data: {'pnr': a},
I'm sorry, I mean 'async: false'! Try that. :)
On Feb 27, 8:54 am, Gelegrodan gelegro...@gmail.com wrote:
Hello!
Thanks you your answer, but it seems like it didnt help!
function pnrexists(a){
$.ajax({
async: true,
url: '/inc/chkusr.php?q=p',
Oops, I just read that you did try 'false'..
On Feb 27, 9:03 am, James james.gp@gmail.com wrote:
I'm sorry, I mean 'async: false'! Try that. :)
On Feb 27, 8:54 am, Gelegrodan gelegro...@gmail.com wrote:
Hello!
Thanks you your answer, but it seems like it didnt help!
function
function pnrexists(a){
var html = $.ajax({
async: false,
url: '/inc/chkusr.php?q=p',
type: 'POST',
dataType: 'html',
data: {'pnr': a},
timeout: 2000,
}).responseText;
I think it's a function scope thing.
How about something like:
function pnrexists(a){
var returnVal = false;
$.ajax({
async: true,
url: '/inc/chkusr.php?q=p',
type: 'POST',
dataType: 'html',
data:
Yeah that seems to work, if i have async: false ;)
Thanks!
On Feb 27, 8:06 pm, James james.gp@gmail.com wrote:
I think it's a function scope thing.
How about something like:
function pnrexists(a){
var returnVal = false;
$.ajax({
async: true,
Just put the call after the each loop
$(document).ready(function() {
$(inp...@name='category']).each(function(){
});
LoopComplete();
});
function LoopComplete() {
alert(All done with loop!);
}
On Jan 28, 10:13 am, johannesF johannes.foss...@gmail.com wrote:
Hi
Need
done with loop!);
});
Thanks for any guidance and info...
Rick
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of MorningZ
Sent: Wednesday, January 28, 2009 10:32 AM
To: jQuery (English)
Subject: [jQuery] Re: function after each
Sent: Wednesday, January 28, 2009 10:32 AM
To: jQuery (English)
Subject: [jQuery] Re: function after each -loop
Just put the call after the each loop
$(document).ready(function() {
$(inp...@name='category']).each(function(){
});
LoopComplete();
});
function
thanks a lot ricardobeat.
work like a charm :)
ricardobeat wrote:
There are two alternatives:
$('#testText').contents(':not(select)')[0].nodeValue;
this one is unsupported but works too:
$('#testText').contents('[nodeType=3]')[0].nodeValue;
Notice that both will keep the
$('#testText').contents(':not(select)')[0].nodeValue;
$('#testText').contents('[nodeType=3]')[0].nodeValue;
I fear these aren't going to work in 1.3 as the new selector engine
doesn't handle textnodes anymore!
On Jan 15, 5:09 pm, kazuar kazuar...@gmail.com wrote:
thanks a lot ricardobeat.
sorry I'm really late to this thread, but it seems like my Text
Children plugin would help in this situation:
http://plugins.learningjquery.com/textchildren/
The Text Children Plugin is a simple little jQuery plugin to return
textual content from selected elements. Unlike jQuery's built-
anyone?
kazuar wrote:
hello, Im kinda new in jquery so maybe its a begginer question.
I have a page with a div containing some text and a combobox.
something like that
div id=testText
hello this is text and this is combobox
selectoption value='1'1/optionoption
This is quite tricky. I could not figure out how to get the text
(probably I should go home:) ).
If there is no other solution here is a dirty trick:
var tmp = $('#testText select');
//remove the select box
$('#testText select').remove();
// get the text within the div
var txt =
$(#testText).clone().remove('select').text()
won't work as the remove method doesn't remove the elements from the
jQuery object, just from the DOM. Here's how it should work:
var e = $(#testText).clone();
var select = e.find('select')[0];
e[0].removeChild(select);
alert( e.text() );
On Jan 12,
Hello,
maybe it could be easier to use the good old DOM in this scenario:
var textNode = $('#testText').get().firstChild; // now we have the
textNode
var textRaw = textNode.nodeValue; // now we have the text string with
all the white-space around
var text = $.trim(textRaw); // we strip the
Hi,
I thank you all for your help.
I guess I'll go with Bohdan's suggestion.
I'll put the text inside another tag (probably p tag...).
thanks again for all your help,
if you think of anything else please let me know.
Kazuar
Bohdan Ganicky wrote:
Hello,
maybe it could be easier to
There are two alternatives:
$('#testText').contents(':not(select)')[0].nodeValue;
this one is unsupported but works too:
$('#testText').contents('[nodeType=3]')[0].nodeValue;
Notice that both will keep the linebreaks. if text() could handle
textnodes this would be much easier.
- ricardo
On
Hi,
It's very hard to tell what you are trying to do from looking at just
the JavaScript. Can you post some HTML and a short explanation of what
you want to achieve.
jQuery has a built in toggle function that shows hidden elements and
hides visible ones. So your second function would be coded
Answer:
This site is hosted at GoDaddy.com - NOT by my choice! The DNS is
hosted outside GoDaddy. If the A record is not pointed to GoDaddy then
GoDaddy uses something they call previewdns.com. Previewdns.com adds
stylesheets, html and js code to the end of the source code of every
page that
I am sure that I will be embarrassed by what the problem turns out to
be but does anybody have any ideas here? I'm still stuck.
d'oh
Thank you!
I'm working on upgrading a calender to AJAX so it is much
snappier, however i'm having trouble getting it to recognise my links.
I have created this function:
function loadContent(id) {
$(#imacalendar).load('inc/eventcalendar.php?event_date='+id);
}
Which is called into use
Yes *date* is a stand in, so the code would be:
script type=text/javascript?
function loadContent(id) {
$(#imacalendar).load('inc/eventcalendar.php?event_date='+id);
}
/script
Then in the body:
a href=javascript:loadContent(2008-5);lt;/a
Like I say, it works if I make the
a href=javascript:loadContent('2008-5');lt;/a
--
Ariel Flesler
http://flesler.blogspot.com
On 22 jun, 09:41, Hinch [EMAIL PROTECTED] wrote:
Yes *date* is a stand in, so the code would be:
script type=text/javascript?
function loadContent(id) {
var say_something;
$(document).ready(function(){
say_something = function(word){
alert(word);
}
});
Karl Rudd
On Mon, Apr 28, 2008 at 6:01 AM, Yuval [EMAIL PROTECTED] wrote:
Hey Mike,
Thanks a lot for your explanation!
Say I insisted on defining it within the $(document).ready
Or:
$(function() {
window.say_something = function(word) {
alert(word);
};
});
--Klaus
On Apr 27, 11:24 pm, Karl Rudd [EMAIL PROTECTED] wrote:
var say_something;
$(document).ready(function(){
say_something = function(word){
alert(word);
}
});
Karl Rudd
On
Hi Yuval,
It looks like you've solved the problem, and your solution is correct.
The reason you didn't find any jQuery-specific information about this is
that it isn't a jQuery problem at all. It's a matter of JavaScript scoping.
Your say_something function is defined inside another function,
The function sayHello() is defined inside the function jQuery.example,
and is thus an inner function or nested function. It exists only
when jQuery.example is executing. It cannot be accessed from outside
jQuery.example without doing some magic with closures.
When you tried to override
You may find this article interesting...
http://osteele.com/archives/2006/04/javascript-memoization
On Mar 2, 11:50 pm, howa [EMAIL PROTECTED] wrote:
Consider I have a simple plugin, e.g.
jQuery.example = function(name) {
sayHello = function(str) {
On 3月3日, 下午11時56分, David Stamm [EMAIL PROTECTED] wrote:
The function sayHello() is defined inside the function jQuery.example,
and is thus an inner function or nested function. It exists only
when jQuery.example is executing. It cannot be accessed from outside
jQuery.example without doing
On 3月4日, 上午12時37分, David Stamm [EMAIL PROTECTED] wrote:
I'm sorry, I thought you were trying to architect your own plugin to
make it easier to override for others.
A useful technique when you're overriding someone else's function, is
to save a reference to the original implementation right
Cool. I found the anonymous function on wikipedia
http://en.wikipedia.org/wiki/Anonymous_function
On Sep 25, 5:49 pm, Matt Stith [EMAIL PROTECTED] wrote:
Using a function like that is called an anonymous function, and in this
case you are passing the anonymous function to the jQuery object,
Thank you. I commented my code and also altered my code to use $
(document).ready(function() { etc..
Totally helps me understand we are just initiating the Jquery code
again to do something new, whe I see it in long form :)
On Sep 25, 9:03 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
That
Using a function like that is called an anonymous function, and in this
case you are passing the anonymous function to the jQuery object, which
stores it and calls on it when the DOM is finished loading.
On 9/25/07, Danjojo [EMAIL PROTECTED] wrote:
2 Questions.
1. are there the correct
That function is also shorthand for this in jQuery:
$(document).ready(function() {
// do something when the DOM is ready
});
Some people like the shorthand. I prefer the longer form because it's
more clear about what it is doing. Ultimate, it's a matter of
personal taste.
--Karl
What doesn't work about it? Is the venueSwap function getting called? Is the
showMe function getting called? Are there any JavaScript errors in firebug?
Are you calling venueSwap(randomVenue) from within a $(document).ready()
callback?
--Erik
On 8/16/07, AJ [EMAIL PROTECTED] wrote:
Hopefully
Okay, here is the fix:
var t = setTimeout( function(){ $('#theatre').click(); }, 500);
Apparently, flash just wasn't loaded in time. Which is weird, because
you can click the image immediately and it's fine. I guess 500ms makes
all the difference :)
That may actually be the better solution in the long run. Will try
that.
Called the javascript function from Flash, and that seems to be the
best fix. Thanks!
Awesome, glad it worked out.
--Erik
On 8/16/07, AJ [EMAIL PROTECTED] wrote:
Called the javascript function from Flash, and that seems to be the
best fix. Thanks!
James Dempster escribió:
Is it possible to make a function that returns a value from an ajax
request. I want the javascript execution to stop until the function
returns it's value. Inside the function it makes it's ajax request
then returns a value based on the data returned. Currently I only
worked it out guys, silly me it's loading data synchronously instead
of asynchronously. Done by doing...
function test() {
var html = $.ajax({
url: some.php,
async: false // -- heres the key !
}).responseText;
return html;
}
:-) thanks all
On Aug 14, 1:54 pm, James Dempster [EMAIL
Are you *sure* you want to do this?
It locks up the browser completely - and all other browser windows in many
browsers - until the ajax call returns.
If it's just a matter of coding convenience, balance that against the
inconvenience it will cause your visitors if the site is slow to respond.
This is what my plan is
http://www.jdempster.com/wp-content/uploads/2007/08/jquery.servercookiejar.example.html
http://www.jdempster.com/wp-content/uploads/2007/08/jquery.servercookiejar.js
I can't think of any other way of doing it. Doing it synchronously ensures
that the value has been
From API.
$(p).contains(test)
HTML:
pThis is just a test./ppSo is this/p
Result:
[ pThis is just a test./p ]
http://www.visualjquery.com
or
http://www.jquery.com
On 6/26/07, cfdvlpr [EMAIL PROTECTED] wrote:
I'm a Coldfusion developer and I know there's a CF function CONTAINS
to do
You don't need jQuery to determine if a string contains a word. That
functionality is built into JavaScript. There are many ways to
achieve this with Strings or Regular Expressions.
One or many resources:
http://www.w3schools.com/js/js_obj_string.asp
Mike
On 6/26/07, cfdvlpr [EMAIL
Do:
$(#one).click( function() {
$(#frame).html( div id='two'Printed Element/div );
$(#two).click( function() {
alert(Hello!);
} );
} );
On 5/30/07, Darrarski [EMAIL PROTECTED] wrote:
I trying to do something like this:
$(#one).click( function() {
$(#frame).html( div id='two'Printed
I'm having the exact same problem.
I section of the page is loaded dynamically via ajax, and it contains
the following:
input type=button id=btntest value=Test /
script type=text/javascript
$(document).ready(function(){
$('#btntest').click(function(){
alert(HEY);
hi..
I tried some debugging and found that IE7 is not having any problem
with it..the problem is with firefoxthis definitely shows that
there is some bug in Jquery itself
Regards,
bingo
On May 27, 8:25 pm, bingo [EMAIL PROTECTED] wrote:
hi,
I have a webpage (say webpage1) that include
i dont have problems with that, how u call the website2?? Try dont use
the same id for the elements or something like that.
On 5/28/07, bingo [EMAIL PROTECTED] wrote:
hi..
I tried some debugging and found that IE7 is not having any problem
with it..the problem is with firefoxthis
83 matches
Mail list logo