jquery

Wondering if there is a .html() equiv that can used for xml ?

$.ajax({ type: "GET", url: "awards.xml", dataType: "xml", success: parseXml }); function parseXml(xml) { I see $("#xml_test").append($(this).find("award").text()); }); returns all the text from my award nodes $("#xml_test").append($(this).find("award").html()); }); my award nodes have some html in them so i was hoping i coul...

A way to fade in the background on load?

I am working on a website design, and I need a way to fade in the background image of the body tag when it is completely done loading (perhaps then a pause of 500 ms). If you see August's website design you will see the background fades in; however, this is done with a Flash background. Is there any way to do this with jQuery or JavaScr...

Why can I not define functions in jQuery's document.ready()?

Functions come up as undefined if I place them in the document.ready() function: $(document).ready(function(){ function foo() { alert('Bar'); } }); foo(); // Undefined Why does this happen? I'm sure I'm just in need of some simple understanding :) ...

Stop events from triggering after they've been triggered once

I have the following code: $('body').mousemove(function() { $('#covering').fadeOut(500); $('.block div div').fadeOut(250) $('.block div div').css('margin-top','160px') $('.block div div').fadeIn(250); }); Basically what I am trying to do is have have a "covering" div fade out (as in this question) and have a few block elements's i...

Jquery Image Gallery with categories

I am going to use the Galleriffic jquery plugin to display my images (please look at demo here: http://www.twospy.com/galleriffic/advanced.html I want to include categories above the gallery, but when each category is clicked I want the image gallery to change dynamically. That meaning, I don't want the page to reload each time a catego...

create Javascript object to pass to wcf service call

I have following method in wcf webenabled service Public Person AddPerson(Person p); As of now in traditional asp.net application i am using scriptmanager and it allows me to created javascript object like following to pass it in ajax call var person = Person(); person.name = "mamu"; phonenumber = 911; ajaxService.AddPerson(person, c...

ajax requests when navigating in browser

Hi. I have a web page which perform several ajax request and is modified, all ajax request are cached on the page. Then user clicks some link and performs the synchronous request to another page. Then user clicks "back" button of the browser. All data which was previously loaded via ajax is lost. Is it possible to restore the page state ...

Skip some code if the computer is slow

Is there any way to detect if a computer is slow and not run some code (by either turning jQuery animations off or just running a function if it is fast)? I know this question is probably really trivial, but I noticed that on some slower computers even the simplest margin animation to move something is done in flashes that doesn't look ...

Saving user input directly into variable in JQuery

I don't want to have a formal form field but save every user input directly into a variable and append new letters to a field every time the user enters a new letter. What command do I need? ...

Resize all containing elements with javascript utilizing em

I have a situation where I think using the 'em' metric would be perfect. I have a container with several elements inside. These elements all use em for dimensions, font-size, borders.. everything. I want to be able to grow or shrink all of these elements dynamically by simply changing the em value of the parent container. At least that...

What sort of memory leaks should I watch for with jQuery's data()?

Should I pair every data() call with a later removeData() call? My assumptions: jQuery's remove() will remove elements from the DOM, and if I don't have any other references to remove, I don't have to do any more clean up. However, if I have some javascript var or object referring to one of the elements being removed, I'll need to clea...

preventing JS running when the page is not loaded

I have encountered a problem. When I use jQuery to load a page that contains heavy javascript, the page freezes. I believe it is because the js executes before the page loads as my local site does not freeze. However, $(document).ready(function(){}); seems not working with dynamically loaded pages? is that true? or anything i could do to...

How do I achieve equal height divs with HTML / CSS ?

I have two divs inside of a container. One on the left, one on the right, side by side. How am I able to make each one be of equal height, even though they have different content. For example, the right div has a lot of content, and is double the height of the left div, how do I make the left div stretch to the same height of the right ...

Watir does not trigger Jquery event handler

I am testing a JQuery Web application. I have a JQuery popup that I simply cannot get the submit button to fire in Watir. The same pattern is used thought the application. I have verified the button exists and have tried click, fireEvent you name it and am out of methods to call. Has anyone solved this? ...

Set mouse focus and move cursor to end of input using jQuery

This question has been asked in a few different formats but I can't get any of the answers to work in my scenario. I am using jQuery to implement command history when user hits up/down arrows. When up arrow is hit, I replace the input value with previous command and set focus on the input field, but want the cursor always to be position...

Use checkbox to set val() for field

Total N00b here, I have a long form wizard that needs one step to be dynamically shown/hidden dependant on a radio button. All is cool with the code thus far. function checkRb () { if($(this).is(":checked")){ //yes $("#do_frick").val("step5"); //alert ("yeah"); }else { //no $("#do_frick").val("s...

Simple jQuery code works fine until site is loaded via https://

I have a simple peice of jQuery code that submits a form and hides/shows some on screen information. It works fine when tested, until loaded via https:// upon which it breaks in IE7. It appears to break totally, with none of the script having any effect. I also get the IE warning that "some elements are insecure". Does anyone have any e...

Simple Javascript question: How do I prevent scrolling with arrow keys but NOT the mouse?

See title. Since I'm using jQuery, any solution via. that would work too. Ideally, I'd like to know both, though. I already have the arrow keys bound to another function on my page (via. jQuery), but having them cause the page to scroll in addition to that causes me problems. I may have known this at one time, but I don't remember it...

jCarousel not working

I have been banging my head for hours on this. I have jCarousel set up almost identically to their "simple" example, and I'm not getting any scrolling. If you set the width of the container higher, you can see that all the images are stacked on top of each other vertically rather than horizontally, but the UL is taking the proper "horizo...

Retrive Field properties in JQuery

Hi, I am new to JQuery. I have created many textfields,textarea fields in a DIV .inside that div i kept separate divs for every field(which includes a label tag, and the field(text/textarea)) in an orderly manner. And now i am trying to retrive the label names and the type,size of those fields ,when cliking on save .How can i do so in...