[jQuery] Re: Problem traversing up list

2009-11-27 Thread Vincent Robert
$('#item1-1').parent().closest('li').attr('id')  will be faster
because it won't retrieve the full list of parents

On 27 nov, 13:20, Michel Belleville 
wrote:
> Well, that must mean that the parent has no id, which is exactly the case :
>
> 
>     Item 1 <= $('#item1-1').parent().parent()
>        <= $('#item1-1').parent()
>          <= $('#item1-1')
>           Item 1 - 1
>         
>         
>           Item 1 - 2
>         
>       
>     
> 
>
> Or you can do this in a better way :
> $('#item1-1').parents('li:first').attr('id')
>
> Michel Belleville
>
> 2009/11/27 ximo wallas 
>
> >  It returns an empty string, so it alerts, but nothing...
> > I will show you all the code:
>
> > First I get the id of the element via URL with the URL param plugin:
> > (It works, if I do an alert it returns the right stuff)
> > var target = $.url.param("target");
> > alert($("#"+target).parent().attr('id'));
>
> > This alerts nothing !!
>
> > --- On *Fri, 11/27/09, Michel Belleville 
> > *wrote:
>
> > From: Michel Belleville 
> > Subject: Re: [jQuery] Problem traversing up list
> > To: jquery-en@googlegroups.com
> > Date: Friday, November 27, 2009, 11:10 AM
>
> > You don't need to use .parentNode() (vanilla DOM) but .parent() (jQuery
> > flavor).
> > Then you can access any attribute using .attr().
>
> > So instead try : $('#item1-1').parent().attr('id')
> > This should "tadaaa".
>
> > Michel Belleville
>
> > 2009/11/27 ximo wallas 
> > http://mc/compose?to=igguan...@yahoo.com>
>
> >>  Hello there, after too much sarching I have almost give it up with the
> >> following.
> >> I have a list with another list nested:
> >> 
> >>     Item 1
> >>       
> >>         
> >>           Item 1 - 1
> >>         
> >>         
> >>           Item 1 - 2
> >>         
> >>       
> >>     
> >> 
> >> Let's say I know the ID of "item1-2" or "item1-1" how can I get the id of
> >> the li (item1)?
> >> I have tried with:
> >> alert($('#item1-1').parentNode().id)
> >> But it gaves me an error, maybe just because it is an aberration...


Re: [jQuery] Re: Functions

2009-11-19 Thread Vincent Robert
What you are looking for is "event delegation".

In your last version, you are attaching a "click" event handler to
every  you add to your table. It can be time and resource
consuming.

A better way is to bind the "click" event to the container where you
will load your dynamic content and wait for the event to bubble up to
the container. Using jQuery, you can retrieve the clicked  using
the "target" property of the event object.

// I assume here that "tb" is not loaded dynamically and is already
here at page load
$(document).ready(function()
{
$("#tb").bind('click', function(event)
{
// Find the clicked  in the table.
// Using closest since user can click on 
// or any element inside of .
var $a = $(event.target).closest('a');

// $a contains the clicked 
// Do whatever you want...
});
});


Denis Caggiano a écrit :
> Now Im get confused...
> Wil, Is the code that you suggested equal that I wrote?
>
> Mine
> $("#tb a").click(function() {
>alert(this.id);
> });
>
> Wil
> $("#tb a").click(function() {
>alert('Test');
>  });
>
> Tks


[jQuery] Re: XHTML or HTML when creating elements?

2009-09-25 Thread Vincent Robert

Actually, jQuery does some parsing by itself first.

The $('') syntax is actually a shortcut to
document.createElement("span"), and yes, the "/" is required here. So $
('') will be faster than $('') which will have to
go through innerHtml.

Regards,

On Sep 24, 6:33 pm, Bertilo Wennergren  wrote:
> I think I read somewhere that jQuery just passes the
> code along to the "innerHTML" function of the browser.
> That would mean that the actual rules are those of the
> browsers' various implementations of "innerHTML" (whatever
> those may be...).


[jQuery] Re: can someone translate this syntax ?

2009-06-05 Thread Vincent Robert

options = $.extend({ ... }, options) is a popular construct in
plugins.

It allows to define default values for a options hash that is passed
as the only parameter.

On Jun 5, 4:22 am, runrunforest  wrote:
> thank you, I don't see that in other plugin, acutually so far i've not
> yet see the same plugin structure.


[jQuery] Re: A better way of writing this code?

2009-05-15 Thread Vincent Robert


On May 15, 3:24 pm, "ryan.j"  wrote:
> as rob said, unless the OP is using the anchor's class itself in
> conjunction with some other jquery selector at that point, the OP
> would be better off just using :hover.
>
> jquery is awesome, but using it to do stuff CSS already does better is
> considerably less awesome.

And less efficient which was a primary concern of the OP :)


[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?

2009-03-24 Thread Vincent Robert

Or the name could be changed for jQuery 1.4 and a plugin provided for
the compatibility with 1.3 code.

It has been the jQuery policy for some time now.

On Mar 24, 5:25 pm, Eric Garside  wrote:
> Yea, the backwards compatibility is really the major issue with making
> a basically cosmetic change.
>
> On Mar 24, 12:04 pm, benjamw  wrote:
>
>
>
> > Yeah, I agree with Mike521, if I were to stumble onto that function
> > without any related documentation, I would assume it to return a
> > boolean value as well.  While I agree with the "kill two birds with
> > one stone" argument against changing the actual function, indexOf
> > seems to be a more intuitive function name while still remaining short
> > in length (shorter than arrayPosition).  Although it may be more of a
> > headache to change now, with the risk breaking innumerable plugins and
> > pages.
>
> > On Mar 23, 10:58 pm, Eric Garside  wrote:
>
> > > If you'd prefer shortcut functionality, try:
>
> > > $.isInArray = function(arr){ return $.inArray(arr) > -1 ? true :
> > > false }
>
> > > On Mar 23, 4:59 pm, Klaus Hartl  wrote:
>
> > > > Read inArray as positionInArray rather than isInArray here...
>
> > > > --Klaus
>
> > > > On 23 Mrz., 21:25, MorningZ  wrote:
>
> > > > > Yeah, like what he is suggesting is to return a boolean value   so
> > > > > now if someone wants the position of the item, it would be a whole
> > > > > separate function to do so
>
> > > > > to me, one single function and checking the value is more "intuitive",
> > > > > maybe if it was named something more inline with what it returns (like
> > > > > for instance, "indexOf") makes more sense, but none the less the
> > > > > function kills two birds with one stone
>
> > > > > On Mar 23, 4:19 pm, Eric Garside  wrote:
>
> > > > > > Honestly, inArray and arrayPosition are equally intuitive to me. If
> > > > > > the value has a position in the array, then it is, by definition, in
> > > > > > the array. inArray returning the array position is a similar check,
> > > > > > but with a more robust ouput. Again, as MorningZ said, you can 
> > > > > > simply
> > > > > > check it's value using a simple gt operator. I honestly don't care 
> > > > > > too
> > > > > > much about inArray returning a non-boolean value which may be
> > > > > > unintuitive to some users. After all, the docs are there for a
> > > > > > reason.
>
> > > > > > On Mar 23, 3:51 pm, Mike521  wrote:
>
> > > > > > > I'm not discussing whether I can or can't use it the way it is, 
> > > > > > > I'm
> > > > > > > discussing which way is more intuitive.
>
> > > > > > > On Mar 23, 3:18 pm, MorningZ  wrote:
>
> > > > > > > > just can't say
>
> > > > > > > > if ($.inArray("value", array) > -1) {
> > > > > > > >    // found in array?
>
> > > > > > > > }
>
> > > > > > > > On Mar 23, 2:59 pm, Mike521  wrote:
>
> > > > > > > > > I was about to use inArray (http://docs.jquery.com/Utilities/
> > > > > > > > > jQuery.inArray) to determine if an element was in an array or 
> > > > > > > > > not, but
> > > > > > > > > I realized I can't use it as a true/false response since it 
> > > > > > > > > returns
> > > > > > > > > the position (and could return 0 if the element was found in 
> > > > > > > > > position
> > > > > > > > > 0 - returns -1 if not found). I was expecting something with 
> > > > > > > > > the same
> > > > > > > > > functionality as the PHP function in_array 
> > > > > > > > > (http://us3.php.net/
> > > > > > > > > in_array)
>
> > > > > > > > > I know it's a minor point but wouldn't it be more intuitive 
> > > > > > > > > if called
> > > > > > > > > arrayPosition? with a name like that I'd expect the 
> > > > > > > > > functionality it
> > > > > > > > > has now.


[jQuery] Re: Is there anyway to grab the Children of an Element?

2009-03-19 Thread Vincent Robert

In your livequery callback, this is the DOM object that received the
event so your "th.name".

$(this) builds a jQuery around this DOM element, a jQuery around your
"th.name".

$(this).children("th.name") returns a jQuery containing the children
of "th.name" that are "th" elements and have a class "name", so
nothing.

If you want the child "b" element, just do $(this).children("b"). You
can also use $(this).find("b").if you are not sure that "b" is a
direct children of your "th.name".

You may have misunderstood what the "children" method is doing, just
recheck the jQuery documentation.

On Mar 19, 2:45 pm, Martin  wrote:
> The code looks like this
>
> $("th.name ").livequery('click', function() {
>                 var $selected = $(this).children("th.name");
>
>                 if($selected.is(":hidden")){
>                         console.log($selected);
>                         console.log($selected.find("b").length);
>                         
> $selected.find("b").removeClass().addClass("subtraction");
>
>                                 $selected.find("a").hide().end
> ().slideDown("slow", function(){
>                         $selected.find("a").fadeIn();
>                 }, "easeOutCubic");
>
>                                 } else {
>                         $selected.find("b").removeClass().addClass("add");
>                         $selected.find("a").fadeOut(function(){
>                                 $selected.slideUp("slow", "easeInQuart");
>                         });
>                 }
>
> };
>
> On Mar 19, 1:31 pm, "T.J. Crowder"  wrote:
>
>
>
> > Hi Martin,
>
> > (Disclaimer:  I'm really new at jQuery, though not at DOM scripting.)
>
> > It sounds like you're saying that this line:
>
> > > var $selected = $(this).children("th.name");
>
> > ...isn't finding any matching elements and that that's why you can't
> > find the  child of the .  What's the context in which you're
> > executing that line?  Some event handler?  If so, on what element?  It
> > would have to be the immediate parent of the  (e.g., a ) for
> > it to find it, since recall that #children finds only _direct_
> > children of the context.
>
> > With a bit more context (no pun!) we can probably figure it out, if
> > the above isn't helpful.
>
> > FWIW,
> > --
> > T.J. Crowder
> > tj / crowder software / com
> > Independent Software Engineer, consulting services available
>
> > On Mar 19, 1:20 pm, Martin  wrote:
>
> > > Hello,
>
> > > I am trying to grab the child of element in my html (see below)
>
> > > 
> > >                                                                           
> > >                
> > > 
>
> > > I am trying to use this Jquery Code to grab the "b" child element of
> > > "th".  I want to change the class element for b from "add" to
> > > "subtraction"
>
> > > var $selected = $(this).children("th.name");
>
> > > console.log($selected); /*  returns Object length=0 prevObject=Object
> > > context=th.name */
> > > console.log($selected.find("b").length);  /* returns 0 */
>
> > > When I try to select b, for obvious reasons the remove and add class
> > > doesnt work
>
> > > $selected.find("b").removeClass().addClass("subtraction");
>
> > > Does anyone have a solution to this problem?
>
> > > Regards
>
> > > Martin Ikediashi- Hide quoted text -
>
> > - Show quoted text -


[jQuery] Re: Select links that end in .png, .jpg or .gif

2009-01-18 Thread Vincent Robert

If you want to be able to easily change the extension list, I suggest
refactoring the whole thing :

function getLinkExtensionsSelector(extensions)
{
return jQuery.map(extensions, function(ext){ return 'a[href$=.'+ext
+']'; }).join(',');
}

var $links = jQuery('.post').find(getLinkExtensionsSelector(['png',
'gif', 'jpg']));


On Jan 17, 10:57 pm, Mike Alsup  wrote:
> > variety, yes:
>
> > $('.post a').filter('[href$=.png],[href$=.jpg],[href$=.gif]')
>
> > On Jan 17, 7:02 pm, Karl Swedberg  wrote:
>
> > > On Jan 17, 2009, at 3:52 PM, Mike Alsup wrote:
>
> > > >> I use a light-box plugin on my 
> > > >> website,http://www.FreeSoftwareWorkshop.com
> > > >> and I need to select the links that end in .png, .jpg or .gif.
> > > >> This is how I use the selector (it works only for .png):
>
> > > >> $(function(){
> > > >>         $(".post a[href$=.png]").lightBox({
>
> > > >> });
> > > >> });
>
> Karl and Ricardo,
>
> Well played, my friends!  :-)
>
> Although I half expect Klaus to come along and lay down a 20 char
> trump card!  :-)   Where are you, Klaus?


[jQuery] Re: My toggleClass is not working.

2009-01-07 Thread Vincent Robert

toggleClass() takes a class name as argument, not a selector.

$(document).ready(function() {
$("a").filter("#click").click(function(){
$("div .six").toggleClass("two");
}).end()
});



On Jan 6, 10:20 pm, amuhlou  wrote:
> In your script it appears that you are trying to toggle the class of a
> div, but in the HTML you have no divs.
>
> On Jan 6, 11:19 am, "thiago silvestre" 
> wrote:
>
> > Hello,
>
> > I'm a beginner with jQuery. My function is not working.
> > *
> > jQuery:**
> > *
> > $(document).ready(function() {
> >         $("a").filter("#click").click(function(){
> >             $("div .six").toggleClass("div .two")
> >         }).end()
> >     });
>
> > *HTML*
>
> > 
> >   Click
> > 
>
> > Help-me plz.
> > Tks :)))
>
> > --
> > Thiago Silvestre
> > Web / Design / Illustration
> > Portfolio:http://www.thisilver.com
> > Msn/Gtalk: thisilver@gmail.com


[jQuery] Re: Refactoring problem with jquery-selectors

2008-12-29 Thread Vincent Robert

If you just want to use your function without changing the signature,
you have to pass along the current this when calling your function.
This is done using the call function JavaScript provides for
functions.

function addClickHandler(tableId, functionName, myUrl)  {
jQuery('#' + tableId + ' tbody').children('tr').click(function
()
{
functionName.call(this,myUrl); // alternate syntax:
functionName.apply(this, [myUrl]);
});
}

On Dec 28, 11:04 pm, j0llyr0g3r 
wrote:
> Hui,
>
> fast reply.:-)
>
> I did as you proposed and it works fine now.
>
> Special thanks for the explanation!
>
> On 28 Dez., 22:26, "Michael Geary"  wrote:
>
> > The problem is the first line in your clickOnTableRowResultSet() function:
>
> >         var row = jQuery(this);
>
> > When you were using that function directly as a click handler, 'this' was
> > set to the element being clicked. But now you are calling the function
> > through an ordinary function call, so 'this' is not the same any more. (It's
> > now the global object, i.e. the window object.)
>
> > To fix it:
>
> > function addClickHandler(tableId, functionName, myUrl)  {
> >         jQuery('#' + tableId + ' ' +
> > 'tbody').children('tr').click(function()
> > {
> >                 functionName(this,myUrl);
> >         });
>
> > }
>
> > And:
>
> > function clickOnTableRowResultSet(element,url) {...}
>
> > -Mike
>
> > > From: j0llyr0g3r
>
> > > Hey guys,
>
> > > i am having problems with some refactoring:
>
> > > I have some html-tables to which i add an onclick-handler like this:
>
> > > CODE:
> > > addClickHandler('myTableID',myFunction);
>
> > > 'addClickHandler' looks like this:
>
> > > CODE:
> > > function addClickHandler(tableId, functionName)    {
> > >    jQuery('#' + tableId + ' ' +
> > > 'tbody').children('tr').click (functionName); }
>
> > > Now, all the functions i pass to this onclick-Handler look
> > > almost the same :
>
> > > CODE:
> > > function clickOnTableRowResultSet() {
> > >    var row = jQuery(this);
> > >    var songUrl = trimAll(row.find('td:last form input
> > > [name=hidden_url_field]').val());
> > >         var trackID = trimAll(row.find('td:last form input
> > > [name=hidden_id_field]').val());
> > >    var trackInfoUrl = "/tracks/track_info/" + trackID;
> > >    sendPlayEventToPlayer(songUrl);
> > >    jQuery.ajax({success:function(request){$('#track_info').html
> > > (request);}, url:trackInfoUrl, async:false}); } CODE
>
> > > with trimAll being:
>
> > > CODE
> > > /*
> > >  * trimAll replaces all whitespace and newlines from a string
> > >  */ function trimAll(str) {
> > >    return str.replace(/\n+|\s+/g,"");
> > > }
>
> > > All of these functions basically do the same: they read out
> > > hidden fields in the last column of the table row, send an
> > > event to a flash- player and update a certain part of the website.
>
> > > The only thing in which they differ, is this part:
>
> > >    var trackInfoUrl = "/tracks/track_info/" + trackID;
>
> > > So i wanted to summarize all my almost identical functions
> > > into one by passing the above mentioned url to them.
>
> > > I tried it like this:
>
> > > Call to addClickHandler on the website:
>
> > > CODE
>
> > > addClickHandler('list_tracks_table',clickOnTableRowResultSet,
> > > '/ tracks/track_info/' );
>
> > > Then I changed my addClickHandler like this:
>
> > > CODE
> > > function addClickHandler(tableId, functionName, myUrl)     {
> > >    jQuery('#' + tableId + ' ' +
> > > 'tbody').children('tr').click(function()
> > > {
> > >            functionName(myUrl);
> > >    });
> > > }
>
> > > And finally summarized my clickOnTable...-functions like this:
>
> > > function clickOnTableRowResultSet(url) {
> > >    var row = jQuery(this);
> > >    var songUrl = trimAll(row.find('td:last form input
> > > [name=hidden_url_field]').val());
> > >         var trackID = trimAll(row.find('td:last form input
> > > [name=hidden_id_field]').val());
> > >    var trackInfoUrl = url + trackID;
> > >    sendPlayEventToPlayer(songUrl);
> > >    jQuery.ajax({success:function(request){$('#track_info').html
> > > (request);}, url:trackInfoUrl, async:false}); }
>
> > > So far, this looks good to me, but unfortunately it doesn't work.
> > > Using debugging i see that 'clickOnTableRowResultSet' gets
> > > passed the correct url, but then the line afterwards:
>
> > > CODE
> > >    var songUrl = trimAll(row.find('td:last form input
> > > [name=hidden_url_field]').val());
>
> > > gives me the JS-error:
> > > Error: str is undefined
>
> > > in function trimAll, which basically means that
>
> > >       row.find('td:last form input[name=hidden_url_field]').val()
>
> > > yields undef.
>
> > > This is what i don't get, i didn't change any part of the
> > > logic which deals with finding the fields, etc.
>
> > > None of my changes affected these parts - at least in my
> > > eyes. But somehow the jquery-selectors seem to be unable to
> > > find my rows?
>
> > > Does anybody see what's the proble

[jQuery] Re: What am I doing wrong here -- htmlTo?

2008-12-18 Thread Vincent Robert

What you want in full jQuery is:

$("#foo").empty().append('');

which is the exact equivalent of

$("#foo").html(''); // html() does call
this.empty().append()

It is very different from the browser innerHtml since your HTML will
first be parsed by jQuery into a DOM tree while innerHtml just insert
your raw source.

One side effect of innerHtml is that the browser may trigger quirk
rendering if you use it. Because the browser does not ensure your HTML
is actually valid, some browsers (like Firefox in XHTML mode) just
switch back to quirk mode if you use innerHtml. (document.write() has
the same kind of issues.)

Always using jQuery to parse your HTML into a DOM tree will allow you
to keep your document in standard rendering.

Have fun with jQuery


On Dec 18, 4:41 am, ken  wrote:
> You're right, somehow I missed it. Thanks everyone!
>
> On Wed, Dec 17, 2008 at 9:22 PM, Ricardo Tomasi wrote:
>
>
>
> > What's wrong with the solution suggested by Kean above? It's prettier
> > than this and works fine.
>
> > $('#foo').html('').find('img').attr
> > ("src","asdf.gif");
>
> > - ricardo
>
> > On Dec 17, 6:03 pm, ken  wrote:
> > > That's basically the form I've developed thus far:
>
> > >             var img = jQuery( '' ).attr( 'src', 'image.gif' );
> > >             jQuery( '#foo' ).html( img ).prepend( '' ).append(
> > ''
> > > );
>
> > > It just seems very inelegant contrasted with the 'normal' jQuery usage.
>
> > > On Wed, Dec 17, 2008 at 11:41 AM, Hector Virgen 
> > wrote:
> > > > Or you could do this:
>
> > > > var img = << your image element wrapped in s >>
> > > > $('#foo').html(img);
>
> > > > -Hector
>
> > > > On Wed, Dec 17, 2008 at 9:36 AM, brian  wrote:
>
> > > >> On Wed, Dec 17, 2008 at 11:13 AM, ken  wrote:
> > > >> > I need to replace the contents of #foo.
>
> > > >> > I would love to use CSS, and if I were starting anew that would be
> > the
> > > >> case,
> > > >> > but unfortunately I am working on an existing application converting
> > the
> > > >> > plain-jane JS to jQuery. I'm simply trying to replace existing
> > > >> functionality
> > > >> > WITHOUT affecting the HTML because the HTML is very fragile (the
> > > >> existing JS
> > > >> > utilizes DOM walking exclusively, so removing/replacing nodes causes
> > a
> > > >> > cascade of fail).
>
> > > >> ok, then, how about just using a string instead of setting the
> > attributes
> > > >> later?
>
> > > >> $('#foo').html('');


[jQuery] Re: Cross domain problems

2008-07-10 Thread Vincent Robert

I may be misunderstading something here but this does not look like a
cross-domain issue to me.

If you are making AJAX request on the same server that served the
page, then you should use absolute URI path without any protocol nor
domain name : $.get("/some/web/service"). This will work whatever
domain your user typed in his browser (www.example.com or
example.com).

If you are really making a cross-domain AJAX call, meaning that you
are calling another server (like yahoo.com or google.com) then
browsers will prevent you from doing that and you should rely on a
proxy webservice that you must create on your server.

Have I missed something obvious?


On Jul 10, 4:07 am, flycast <[EMAIL PROTECTED]> wrote:
> I have determined that the error was from a different script. Sorry
> about the confusion.
>
> After working on the document.domain I could not get it to work/help.
> The load statement would just not return any result.
>
> The solution that Jeffery offered above worked like a champ.
>
> Thanks for all your help.
>
> On Jul 9, 11:56 am, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
>
> > I had this same problem, which I solved by parsing the window.location.href
> > prior to making the ajax call, based on the current host used to access the
> > site.
>
> > var url = /(https?:\/\/[^\/]+)/.exec(window.location.href)[1] +
> > '/pathtomyresource';
>
> > JK
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> > Behalf Of Erik Beeson
> > Sent: Wednesday, July 09, 2008 9:33 AM
> > To: jquery-en@googlegroups.com
> > Subject: [jQuery] Re: Cross domain problems
>
> > The protocol *must* be the same (if the page ishttps://.../thenthe
> > ajax request must also be tohttps://.../).
>
> > The port *must* be the same.
>
> > The host name *must* have the same SLD [1], and if the subdomains are
> > different, document.domain *must* be set to the SLD.
>
> > I'm certain that this can work as I do it all the time. If you're
> > still having trouble, could you create a page that demonstrates the
> > problem?
>
> > --Erik
>
> > [1]http://en.wikipedia.org/wiki/Second-level_domain
>
> > On 7/9/08,flycast<[EMAIL PROTECTED]> wrote:
>
> > >  I tried setting document.domain = 'site.com';
> > >  It works with a domain of site.com but notwww.site.com. I now get the
> > >  following message:
>
> > >  [Exception... "'Permission denied to call method XMLHttpRequest.open'
> > >  when calling method: [nsIDOMEventListener::handleEvent]" nsresult:
> > >  "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: ""
> > >  data: no]
>
> > >  This seems to be a different problem.
>
> > >  BTW...here is a Mozilla link to the issue of cross domain and the use
> > >  of 
> > > document.domain:http://www.mozilla.org/projects/security/components/same-origin.html
>
> > >  On Jul 9, 1:30 am, Alexsandro_xpt <[EMAIL PROTECTED]> wrote:
> > >  > Well, I thought this is security browser issue.
>
> > >  > I always solve this problem this way:
> > >  > Eg.:
>
> > >  > To ajax this:http://feedproxy.feedburner.com/undergoogle
>
> > > > I create
> > this:http://blog.alexsandro.com.br/application/load/feedproxy.feedburner.c..
> > .
>
> > >  > --
> > >  > Alexsandrowww.alexsandro.com.br
>
> > >  > On 9 jul, 00:18, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
>
> > >  > > Add this somewhere in your javascript:
>
> > >  > > document.domain = 'site.com';
>
> > >  > > Google document domain
>
> > >  > > --Erik
>
> > >  > > On 7/8/08,flycast<[EMAIL PROTECTED]> wrote:
>
> > >  > > >  Simple problem (I think)...
>
> > >  > > >  I am new to JS and ajax.
>
> > >  > > >  I am building an ajax capability on a clients site. I am running
> > into
> > >  > > >  cross domain problems. If I get the page using the url
> > formhttp://www.site.com
> > >  > > >  but I do a load using the url form "http://site.com"; (www vs. no
> > www
> > >  > > >  in the url) I get nothing but a js error.
>
> > >  > > >  What is the best way to handle making sure that if the person is
> > at
> > >  > > >  the site with OR without the "www" in the url that the .load will
> > >  > > >  still work?


[jQuery] Re: Running script onLoad instead of ready

2008-07-10 Thread Vincent Robert

If you want code to execute before the page is ready, the you should
just inline it in your  tag. Note that you won't be able to
access or modify any DOM component of the page, all you can do is
append some new DOM nodes at the beginning.