[jQuery] Re: appending to problem
Hi, same problem here. After a little rewrite, IE seems to understand this: var link = $("").appendTo($("head")); link.attr({ rel: "stylesheet", href: path }); Anybody knows any details why IE doesn't like the link-append in jQuery 1.4? On 15 Jan., 03:21, easyOne wrote: > I tried to append tag to tag. For this, I wrote > $("",{...}).appendTo("head"); // jquery 1.4 style > or > $("head").append(""); // jquery 1.3.2 style > . > > Both work nice on Firefox, Chrome, Safari, Opera but IE... > > In case of IE, it works with jQuery1.3.2, but never do anything with > 1.4. Inspecting DOM, there's surely appended tag to .
[jQuery] Re: Show/hide effect div on mouseover
Hi, You can also do this using this plugin : http://plugins.jquery.com/files/jquery.event.hover.js.txt, which overloads the jQuery 'hover' event (just like hoverIntent, but it's smaller). Works fine, and you can tweak it. Flo
[jQuery] Re: simple click drop down menu
Hello, Superfish jQuery plugin is really great to construct a simple manu. But it will work on hover event, not click : http://users.tpg.com.au/j_birch/plugins/superfish/ If you don't want to use this, you have to do something like that : // to close your when clicking on a $('.menu ul li').click(function(){ $(this).parent().css({'visibility':'hidden'}); /* do other stuff like loading content, http call... */ }); } You may also use the hide() and show() jquery function, or even fadeIn / fadeOut or animate() for more fancy tricks... Good luck Flo On Sep 29, 2:26 pm, runrunforest wrote: > Hi, > > I need help to close the ul back up when i click on the white space or > on the options link. > > This is what i've got so far > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > http://ajax.googleapis.com/ajax/</a> > libs/jquery/1.3.2/jquery.min.js"> > > $(function(){ > $('.menu').click(function(){ > $(this).next('ul').css({'visibility':'visible'}); > });}); > > > > * {margin:0; padding:0;} > .menu { position:relative;} > ul { position:absolute; visibility:hidden; border:solid 1px blue } > ul a {display:block;} > > > > > options > > game > music > movie > > > >
[jQuery] Re: Problem controlling links of appended html
Hello, You should try to launch your new jQuery behaviour in a separate function like this : ... { $("#main_area").append(""); behaviourOnNewElements(); } function behaviourOnNewElements() { $(".pics a").click(function(event){ return null;
[jQuery] Re: ajax returned data format
Thanks for your answers. I'm pretty sure my ajax call is done, thanks to firebug (which is great by the way) and a few 'alert'. I suspected extra white space (I must try a javascript trim...) at the end of my string, I'll try JSON (must learn about it before). Great idea to return an array too, with several identified chunks of data, it should be handy for me. By the way, do you know good links about constructing 'heavily ajaxed' applications, managing and formatting data ? I'll soon have to deal with this kind of project. But first JSON and arrays... thx again Flo On Sep 23, 11:42 pm, "morris...@ingenious.org" wrote: > Flo, > > I would suggest using $.getJSON() instead of the straight $.get() if > you have the json_encode function available to you (PHP 5.2.x+ should > have this). This is because you may have some extra white space at the > end of what you are returning now. > > in your php do this > > echo json_encode(array('success' => 'ok')); > ?> > > in js do this > > $.getJSON("phpfile.php", {param:param...}, function(data) { > if(data.success == 'ok') { > > } > > }); > > Chris > > On Sep 23, 11:24 am, Florian Motteau wrote: > > > Hi all, > > > I've been working with jQuery for a few weeks now (still a noob so :), and > > I'm a bit confused about getting information from a php file. Basically : > > > MY JAVASCRIPT FILE: > > $.get("phpfile.php", {param:param...}, function(data) { > > > if(data == "ok") { > > ...do stuff... > > } > > > }) > > > MY PHP FILE: > > > echo "ok"; > > ?> > > > In this dumb example, I'm unable to match the 'data' returned variable with > > the value I assigned to it in php (I can't manage to enter my 'do stuff'), > > yet its value is 'ok' if I display it. I have no problem to retrieve html > > code from php and inject it in my pages, but I can't test it as a regular > > javascript string. > > > What's wrong in this ? What have I missed about the 'data' format ? Do I > > have to 'cast' data to a javascript string (and if so, how ?) ? > > > And finally, sorry about my english, I'm french :-) > > > thanks > > Flo