I'd guess it's because arguments isn't really an array (it has a length
property, but none of
Array's methods).
Something like this might do the trick:
jQuery.fn.sort = function() {
for(var i = 0, args = []; i arguments.length; i++)
args.push(i);
return this.pushStack(
I got an email today that one of my plugins might be a cross-site
scripting/security risk because the plugin uses the Function.call()
method, like so:
$.fn.plugin = function(elem, options, callback) {
callback.call(elem, options);
};
Has anyone heard of or dealt with this problem? If it
relating to this,
or is it just FUD? I mean, there's tons of ways to do XSS stuff -
triggering a function call seems hardly worthy of additional
attention.
Plus, if you're in a situation where XSS may be a factor, this is
probably the least of your worries.
--John
On 3/23/07, Luke
Why not see if you can get involved with the 'official' effort? John Resig
mentioned at SXSW
that part of what's taking time is getting things translated, and finding
people who speak the
language (German in this case) to help organize and maintain the non-english
versions. Maybe you
could
Daemach2 wrote:
Try doing console.log($(this).css(backgroundColor)) in the second function
to see what those background colors are showing up as.
Watch out for Safari, it sometimes returns 'rgba(0,0,0,0)' instead of
'transparent' ...
Luke
--
zinc Roe Design
www.zincroe.com
(647) 477-6016
Yansky wrote:
I'm having a bit of trouble figuring out how to do this. What I'd like to do
is find the first parent element that has a background color that is not
transparent.
This is what I've tried so far, but with no success:
$('.elemToFade:first').parents([EMAIL PROTECTED] !=
to seeing everyone!
--John
On 3/10/07, Luke Lutman [EMAIL PROTECTED] wrote:
Are there any other jQuery folks at SXSW this weekend? Apparently
John Resig was at the Web Vector graphics panel this afternoon, but I
missed him.
Anyone interested in grabbing a beer in Austin to toast jQuery
Are there any other jQuery folks at SXSW this weekend? Apparently
John Resig was at the Web Vector graphics panel this afternoon, but I
missed him.
Anyone interested in grabbing a beer in Austin to toast jQuery? :-)
Maybe during the lunch break on Sunday...
Rawk!
Luke
I should've replied earlier ... I've sent Sam a Flash 7 version of the fla. The
filters are just
to make the text look better (adding an invisible drop shadow gets rid of the
colour artifacts
produced by 'anti-alias for readability' in Flash 8). Everything should work
fine without the
Yehuda Katz wrote:
1) Are you using Rails?
Yes :-)
3) Would you prefer an approach that generated JS by writing Ruby
helpers that generated jQuery code, or an approach that made is easier
to link up existing jQuery code into Rails?
4) If you've used jQuery with Rails, what issues have you
Klaus Hartl wrote:
Luke, have you tried to use the AssetPackager plugin? It is not totally
automatic as you have to define the scripts to be packed in one yml, but
thats okay for me. I think merging whatever JavaScript there is into a
file is not always good for files that are only
I don't think you need window[] or document[], try:
$('#flash_id')[0].callback();
Luke
spinnach wrote:
Hi,
i'm using the jQuery flash plugin to embed a flash movie to a webpage,
and the ExternalInterface to communicate between flash and javascript..
in firefox everything's working as
John Resig wrote:
- Add jQuery support to a popular CMS/Framework
jQuery for Ruby On Rails would be fantastic :-)
Luke
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
If it's an object vs. embed issue, you could overwrite
jQuery.fn.flash.transform with a
function that returns an object tag for IE.
Getting object to work is a bit tricky, but this A List Apart article
(http://alistapart.com/articles/flashembedcagematch) describes the known issues.
Luke
Matt Kruse wrote:
1) There seems to be a lot of emphasis on using selectors and
pseudo-selectors to access everything. It makes code short and simple, but
is it really the most efficient?
Reusing selectors helps performance.
You can reuse a selection by storing selected elements in a
# Background
Inserting an ActiveX control (i.e. flash movie, quicktime movie) with an
external javascript
(i.e. jQuery) should avoid the ugly grey box and having to click to activate.
See:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp
.. for some reason
in seems that if I cache the element ($('#'+i)[0]) it will never detect
the new method.. so I perform the getElementByID() function per loop cycle.
Luke Lutman wrote:
Since you're not doing anything fancy, why not just pass the config as
flashvars and save
yourself a world
Sorry, forgot to mention you'd also need a bit of javascript to go with
that:
jQuery.fn.doWhatever = function(foo,bar) { ... }
Luke
Luke Lutman wrote:
It is now time to let the fanciness commence ;)
But of course ;-) Why not fight fancyness with fancyness? In your flash
movie, try
Ok, did a quick test in FF and Safari :-)
- The function doesn't wait, it makes all the requests at once (more or less).
- The variable gets overwritten.
- It doesn't interrupt the download.
One thing I did find was that if I do:
var img = new Image();
img.onload = function(){
var that =
Ahh, I missed that it was an open-source player.
I'll shut up now ;-)
Luke
Brice Burgess wrote:
Luke Lutman wrote:
In your flash
movie, try this actionscript on the first frame:
getURL(javascript:$('#FP').doWhatever('abc',123););
Correct me if I am wrong.. but I *think* you're
Hi Everyone,
I was frustrated today with IE not supporting the :before and :after CSS2
selectors, so I've
written a plugin that (more or less) enables them :-)
http://jquery.lukelutman.com/plugins/pseudo/
Luke
P.S. Fun fact: the plugin hacks IE with it's own proprietary junk, like so:
* {
I've run into this before too...
Calling a method (i.e. setConfig(), setVariable()) of the flash player (in
Firefox it's an
NPObject, in IE it's an ActiveX object) before the swf has loaded will throw an
error.
The ready event fires before your swf has loaded, which throws an error.
The load
Here's what I use:
$(window).bind('load', function(){
var preload = [
'/images/assets/file/1.gif',
'/images/assets/file/2.gif',
'/images/assets/file/3.gif'
];
$(document.createElement('img')).bind('load', function(){
if(preload[0]) this.src =
at once could take up 870 connections! It might not make much
difference, but it
doesn't hurt, either ;-)
But I do like the technique! Does that actually load , wait and repeat?
and you don't have to re-trigger?
Yep, you got it :-)
Luke
On 2/5/07, *Luke Lutman* [EMAIL PROTECTED] mailto
Ⓙⓐⓚⓔ wrote:
I love the brevity of your solution!!
$(document.createElement('img')).bind('load', function(){
if(preload[0]) this.src = preload.shift();
}).trigger('load');
Thanks ;-)
It works because the onload handler gets reused -- it fires after the
image finishes loading, which
Unfortunately not. sIFR measures the element that's being replaced, then scales
the font to fit,
so unless the html font and the flash font are very similar, the sizes will be
different (and
difficult to predict).
I've been working on a text-replacement plugin that takes the opposite approach
There's actually already a text-resize plugin for jQuery, called jQEm:
http://davecardwell.co.uk/geekery/javascript/jquery/jqem/
I've got a stripped down version of the above that I use:
http://jquery.lukelutman.com/plugins/emchange/jquery.emchange.js
Have fun :-)
Luke
Will Mo wrote:
Thank
Here's the link to my plugin:
http://jquery.lukelutman.com/plugins/flash
Luke
Sam Sherlock wrote:
have you tried Luke Lutmans flash plugin?
Its inspired by sIFR, swfObject UFO.
using the flash plugin in place of swfObject.
On 10/01/07, * xmrcivicboix* [EMAIL PROTECTED]
?
Luke Lutman wrote:
Here's the link to my plugin:
http://jquery.lukelutman.com/plugins/flash
Luke
Sam Sherlock wrote:
have you tried Luke Lutmans flash plugin?
Its inspired by sIFR, swfObject UFO.
using the flash plugin in place of swfObject.
On 10/01/07, * xmrcivicboix
I've run into the same problem with IE :-(
I did more or less what Dave suggested (untested, of course!):
var $tmp = $('#some-element')
.append('div style=position: absolute; width: ' +
$('#some-element').css('font-size') + '; /')
.find(':last-child')
var fontSizeInPx = $tmp.width();
Luke Lutman wrote:
I've run into the same problem with IE :-(
I did more or less what Dave suggested (untested, of course!):
var $tmp = $('#some-element')
.append('div style=position: absolute; width: ' +
$('#some-element').css('font-size') + '; /')
.find(':last-child')
var
Agreed, Klaus ... but Sam's not trying to get around it ;-)
He just wants alternate content to show when flash is blocked, rather than the
big ugly 'click
to play the flash movie' placeholder that FlashBlock stuffs in.
FWIW, I think FlashBlock is pretty silly...
Luke
Klaus Hartl wrote:
Sam
I had to do something similar recently. What I did was overload the css and
curCSS functions in
jQuery to accept an array (of css property names), and return an object whose
toString method
builds the inline css string.
For example:
$('#single').css('font-size'); - 12px
I haven't used ExternalInterface before, but I have used:
getURL(javascript:myfunction(123,'abc'););
To call a javascript function from flash. This works like a charm if passing
numbers and strings
(or JSON strings) to the function will suffice, and is backwards compatible (as
far as Flash 6,
Hi Sam,
I had a look, and FlashBlock blocked UFO and SWFObject movies, and sIFR
showed the alternate content, so I'm guessing that by 'works with
flashblock', you mean that the alternate content is show when flashblock
is on, correct?
From what I can tell, Flashblock looks for two things
Dave Methvin wrote:
You start with 10 lines of jQuery that would have been 20 lines of
tedious DOM Javascript. By the time you are done it's down to two or
three lines and it couldn't get any shorter unless it read your mind.
I think that should be the first paragraph on the homepage!
Hi jQuerians,
I ran into a bit of an odd problem this morning: $.css returns values in
whatever units they
were set with in the stylesheet (Safari and Firefox both return values in px
regardless of how
they were defined).
For example:
p style=font-size: 12px; letter-spacing: 1emTesting,
Ok, I did a little bit of digging, and it looks like this is actually a
bug. In the curCSS function, on line 452 (r627), there's a check
for elem.currentStyle :
} else if(elem.currentStyle) {
// stuff only ie should see
}
Apparently, this property exists in Opera, but contains the bogus
values.
code
comes from an 'external' javascript file anymore.
Using JSMin (http://www.crockford.com/javascript/jsmin.html) instead of
Packer solves the problem ... but it's extra work.
Does anyone have suggestions on how to preserve the 'externalness' of
the packed version of jQuery?
Thanks,
Luke
Jörn Zaefferer wrote:
As far as I know, that is yet an unresearched topic.
So far there is a nice guide and tons of example code for writing plugins,
but not for
extending them.
So far someone extends his local copy for his own needs and trie to
contribute them back to
the original.
Jörn Zaefferer wrote:
Good example. But I think the same effect can be achieved by simply using the
standard
settings/options mechanism. You can just define a certain function as default
and override it
via options.
Yep, that would work nicely, as long as the default settings/options were
the sifr example since the class
is added to the #hdr from within the each call
that might not be crucial anyway - just perplexing - would like to know
more to further my understanding though.
thx -S
On 11/11/06, *Luke Lutman* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote:
Can you
Hey Sam,
Thanks for all the kind words :-)
I've (been lucky?) never to need to communicate between flash and
javascript, so I'm a bit out of the loop on how that whole process works.
If it's simply needing access to the embed / element after it's
inserted into the dom, it should be pretty
either. Its a pain!!!
For flash8 theres extendedinterface though - which looks great!
would be interesting to see what you make of the above
-S
On 10/11/06, *Luke Lutman* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote:
Hey Sam,
Thanks for all the kind words
I'm loving the full index :-)
A couple of suggestions come to mind ... having all of the parameter types and
names in the
left-hand column makes the list much harder to scan. Maybe it's just a styling
issue -- like
making the parameter types and names less prominent (smaller, faded out) --
Can you post the code (or a link to it)?
What error does it throw?
...
Also, my text-replacement example
(http://jquery.lukelutman.com/plugins/flash/example-text-replacement.html)
isn't fully cooked yet -- it's functional, but I'm planning to develop
it as a proper plugin (soon, hopefully!).
Dang! You beat me to the punch, Mike. I've been working on (more or less) the
same thing, and
was just finishing up my documentation and examples last night when you posted
yours... too bad
we didn't find out sooner.
Here's my version:
http://jquery.lukelutman.com/plugins/flash/
I've
escape() and unescape() have always worked for me :-)
i.e.
escape('The quick brown fox') - The%20quick%20brown%20fox
unescape('The%20quick%20brown%20fox') - The quick brown fox
Luke
Truppe Steven wrote:
Mark Gibson schrieb:
Javascript has the functions:
decodeURI(s) and
:
http://markdbd.com/proyectos/jquery_test/
Regards,
On 11/6/06, *Luke Lutman* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote:
I had a similar problem, Mark.
Upgrading to the latest revision of jQuery (522 at the time) solved the
problem :-)
Luke
Mark D.B.D
I had a similar problem, Mark.
Upgrading to the latest revision of jQuery (522 at the time) solved the
problem :-)
Luke
Mark D.B.D wrote:
Hi all,
When I finished my little project with jquery I decided to add my
adsense code. After this I saw there is something that makes jquery
I noticed the same problem when trying to wrap new 'embed' and 'object'
elements, but didn't
have time to write it up. I only get the errors in Firefox (v2) -- Safari 2 and
Opera 9 are fine.
// this works
$(function(){
$(document.createElement('div'));
});
// error: f.apply is not a
= parseFloat(val);
// ingnore empty values
if(val)
r[key] = val;
});
return r;
};
Then call it like this:
q = $.query($(this).attr('href'));
Luke
Chris W. Parker wrote:
On Tuesday, October 31, 2006 10:46 AM Luke Lutman
Klaus Hartl wrote:
That won't work for two reasons: $(this).attr('href') most likely
returns a complete url, thus there is no leading ?.
Oops! Yes, of course.
Secondly if you have a parameter like number=0, it won't be put into
the hash because after parseFloat val == 0 which evaluates to
You make a good point about mobile devices, etc. Klaus -- point taken.
I'm still not convinced about using object / though -- for me it's got
a number of cons:
* It's messy -- you need different code for different browsers. All the
browsers support object /, but IE wants a different object /
does it get invoked, like in
Luke's example.
Thanks,
-Steve
Jörn Zaefferer wrote:
Luke Lutman schrieb:
I was thinking of something a little fancier ;-)
jQuery.query = function() {
var r = {};
var q = location.search;
q = q.replace(/^\?/,''); // remove
Good points about the zip code, and running $.query() all the time, Mike.
Maybe the two approaches can be combined? Run the code to munge the
query string the first time $.query() is called. Cache two sets of
results -- a 'raw' set and a 'type cast' set -- in a closure, and return
one of the
Is there a jQuery method or plugin for parsing the browser's query string into
an object?
I looked through the api and did a bit of searching around, but no luck ...
Thanks,
Luke
--
zinc Roe Design
www.zincroe.com
(647) 477-6016
___
jQuery mailing
Looks interesting, but the example pages crash Safari (2.0.4, OSX 10.4) :-(
Luke
Andrea Ercolino wrote:
Hola.
I just released Chili, a free syntax highlighter script, written in
jQuery, and based on the Dan Webb's Code Highlighter, which I found a
couple of weeks ago thanks to a link on
Are you running your code before the dom is ready?
Try this:
$(document).ready(function(){
$(body).append('div id=ajaxBusy class=ajaxBusy.../div');
});
Luke
--
zinc Roe Design
www.zincroe.com
(647) 477-6016
sdkester wrote:
Thank you for the suggestion. I tried that and get an
I'd go for something like option 4, but instead of the custom attribute/DTD
stuff, just give it
a classname. i.e.:
div class=closed/div
Luke
Raffael Luthiger wrote:
Hi,
I've seen searching lately for a good way of storing preferences which a
jQuery script needs later on. The specific
with the XPath parent axis selectors? Shouldn't they be
matching something?
Is there a better way to do this than the last method? I'd rather not iterate
over unnecessary
elements.
Thanks,
Luke Lutman
P.S. This is my first post to the list, so please be gentle
Hey John,
Thanks for the reply, it's much appreciated.
I played around with using $(span:first-child).parent(div), but it
selects the opposite of what I need (divs *with* a span:first-child
rather than divs *without* a span:first-child).
Is there a way to remove the above from a larger set of
62 matches
Mail list logo