jquery

jquery toggle and multiple links

hi all, i'm using jquery toggle to show/hide a div on different links. It shows/hides them fine, however if you click on one of the other links before closing the first link toggle, the first div is still shown. Is there any way of checking if there are any other open toggle events open, if so, close them and then continue with the new...

jQuery - readability vs. performance(?)

Considering the to fragments of jQuery code which does the same: $("<div />").css({ "background-color" : "red", "color" : "white", "border" : "solid 1px black" }) .appendTo( someElement ); and $("<div style='background-color:red;color:white;border:solid 1px black' />") .appendTo( someElement ); The first one is more reada...

jquery ajax function

function decreased(param) { console.log(param); $.ajax({ type: "GET", url: "scripts/closed.php", data: "name=" + param, success: console.log('success'), }); } I don't know why my function isn't working. The path is correct the param is correct if i type in closed.php?name=param the script there works and in th...

read wikipedia url's content using jquery, cross domain network call.

jQuery.ajax( { url:'http://en.wikipedia.org/wiki/Football', type:'get', dataType:'jsonp', success:function(data){alert(data);}, } i want to read wikipedia page from my domain using jQuery, iam doing as above. as expected wikipedia is sending data as pure html, but when we use $.ajax to get cross doma...

Cross Browser Mouse Follow?

My client has requested that they they want a football to follow the mouse on their site. Totally stupid if you ask me, but he's determined to get it done. Problem is all the scripts I have found are old school and are not cross browser. Does anyone know of a solution either in JavaScript or jQuery that will work in all the newest brow...

Highlight live search results

I'm trying to highlight the text that matches the query in a live search using jquery.highlight. The live search works fine but the styling for the highlighting applies then it disappears. Am I doing something wrong? JQuery $(document).ready(function() { $("#search").bind("keyup", function() { var form = $(this).parents("form")...

.getJSON() returns null

I'm using jQuery to get and parse JSON using example flickr service : http://api.jquery.com/jQuery.getJSON/ everything works fine if i use flickr url , the problem starts when i try to get my own service. It works when I save the output and read it from file but i doesn't work from the server url. Firebug shows two that the object is n...

send ajax form to web service, only after successful validation

my target is to create form that validated in the client side, and only when it is valid, send ajax call to asmx web service. i manage to do that two separately: client-side validation and ajax send to web service, and i want to combine this two. how?.. i have this form (i simplify everything for simple example): <form id="ContactForm"...

jQuery speed: which one is faster, {ul#parent li} or {li.child}?

Just curious if there is an established "best way" to target child elements inside of a parent element. For example, if I want to create a click event on the children of a parent element, which one should be preferred? a) give the parent element and id and do: $('ul#parent li').click(function() {}); b) or, instead, give each of the c...

jQery mouseover to show hidden div and to show div if only mouse still over the div

Hi, I have a problem with my mouseover and mouseout. When mouseover a link, it shows hidden div, and mouseout of a div it hides the Div. Problem is that if mouseover a link, then I move mouse somewhere else which is not over the div, the div won't go away. If I use mouseout event of the link to set the visibility of the Div, then I wo...

get Unread Count of Google Reader using Javascript(jQuery)

i'm trying to get the unread count of my google reader using javascript. tried the following: var unreadURL = "http://www.google.com/reader/api/0/unread-count?all=true"; $.ajax({ url: unreadURL, success: function (data) { console.log(data); } }); but im getting a 401. i think i have to authenticate or something...

jquery keystroke wait

Hi, How can I stop the loop until a key is pushed? for (i=1;i<10;i++){ $('input').eq(i).css('border','1px solid red') //Wait a keystroke ?????? } ...

Custom client side navigation, how to apply it twice on the same page?

Hi I have this code: $(document).ready(function(){ //how much items per page to show var show_per_page = 3; //getting the amount of elements inside content div var number_of_items = $('#content').children('span').size(); //calculate the number of pages we are going to have var number_of_pages = Math.ceil(numbe...

SVG problem; updating moving elements is CHOPPY, why?

Drawing more than ~5+ SVG lines with the code below makes performance choppy when moving elements, especially if long SVG lines are drawn. Is this just a natural SVG performance limitation (because of the svg canvas size) or is there something fishy with my code? Project in action can be seen here (only supports Chrome and Firefox so fa...

Detecting Download Status in Firefox

Is there any way to detect whether a download has completed or is how much it has downloaded , in the context of a greasemonkey script Or and extension .(i.e) how to detect if firefox is still downloading a file or not, in a greasemonkey script or an extension ? Also please give a Reliable way for using jQuery in greasemonkey. ...

is Raphaël using canvas or svg?

I've been looking for a good vector solution, and have heard good things about Raphaël. But all over its docs it talks about defining canvases, which just made me confused. Is Raphaël a canvas or SVG library? ...

jQuery, writing if statement with .bind vs .focus looking for alternate way to execute

Brief synopsis, this code works beautifully and does what it is supposed except with radio buttons on webkit. $('input, textarea, select').focus(function(){ $(this).parents('.row').addClass("hilite"); }).blur(function(){ $(this).parents('.row2').removeClass("hilite"); }); I did some research and tested it a few...

Delete a div or span with a id=".xxx"

Hello, I am unable to delete a div with an id with a period or an asterix. <div id="*xxx."></div> <div id=".xxx*"></div> I have the jquery code, which deletes the <div id="xxx"></div> but not the above. Not looking for the jQuery code, but does it need a forward slash? ----req by anurag-------- // JavaScript $('.s').click(functio...

Jquery show div when link gets clicked

Im trying to show/hide a div using jquery when a link gets clicked. I put this in my head section: <script type="text/javascript"> $("#attach_box").click(function { $("#sec_box").show() }); </script> I have a link that looks like this: <a href="#" id="attach_box">+ Add a Postal Address (If Different)</a> And a di...

Dynamically changing css for jquery treeview using c#

Hello, I have a c# code which generates a stringbuilder with ul and li html tags with loaded data from the database. Using this data i am creating a treeview using a jquery treeview plugin. Jquery treeview has its style properties written externally in an css file. My requirement is, i should be able to change the parent node icon dyna...