jquery

Need urgent Help with $.GetJson

Hello everyone, I'm using Jquery with WCF... and I'm struggling with getting values when it's returned as arrays by the WCF service... Here's my Jquery code $(document).ready(function () { $('#Button1').click(function () { alert('Getting Data....'); $.getJSON("http://localhost:21030/Service1...

When using $.ajax in jQuery, how can I deliberately throw an error in the loaded document?

In my document I have this script: $.ajax({ type:"POST",url:"ajax.php",data:data, success: function() { //onsuccess }, error: function() { //onerror } }); How can I, in the document ajax.php, deliberately throw an error? Is it sufficient to just throw an 400 HTTP Status Code or something? (And if so,...

jquery fadein does not fadein child div elements

hello, I have an seemingly simple question. I am using jquery to fade in/out some content within a div labeled #home when I click a button. My issue is that if I create a child DIV within the #home div...whenever I click the button for #home to fade back in, the contents of the child DIV does NOT fade in. However, any child, "p" or ...

Set a visual focus on a element with jQuery

Hello, I've seen some pages with a cool visual focus on elements for example a div: The white box is a div and the rest of the page is dimmed out. Are there jQuery plugins for that effekt? ...

handling event bubling in jquery

iam having links as shown below <a item='1' href='javascript:void(0)'><img class='icon1' /><span>text1</span></a> <a item='1' href='javascript:void(0)'><img class='icon2' /><span>text2</span></a> <a item='1' href='javascript:void(0)'><img class='icon3' /><span>text3</span></a> <a item='1' href='javascript:void(0)'><img class='icon4' /><...

jQuery MouseEnter and MouseOut events with .toggle() reverse when the mouse is already over the element onLoad?

Hi, I have a dropdown menu working great with the following code: $('#menu ul li').mouseenter(function(){ $(this).children(".dropdown").toggle(); }).mouseleave(function(){ $(this).children(".dropdown").toggle(); }); This works as you would expect. The issue is that if the mouse is already mouseenter on the $('#menu ul li') whe...

jQuery selector performance - One statement vs two.

Is there any performance difference between using two separate calls to hide two elements, or would it be more/less efficient to use only 1 statement? Is there any practical difference? $('#container1').hide(); $('#container2').hide(); vs: $('#container1, #container2').hide(); Also, which do you think is more readable? ...

jQuery: how to include attributes on click during .ready() ?

I'm trying to convert all my old javascripts to jquery but I'm a bit confused how can I convert my click event with attr. The old javascript looks something like: function MyFunction(string1, string2){ doSomething(string1); doSomethingElse(string2); } And then I call it with <a href="javascript:MyFunction('string 1','string 2...

Dynamically updating html table with JSON using jQuery for complex object

I am still new to JSON/jQuery. I need some quick guidance on how to dynamically populate Html table on the client. My table has fixed columns, but rows grow dynamically depending on data retreived. Say I have a Web Method on the server (GetActiveUsers) that is returning, say n- users. I am using this sql: select userId, Title,Surname,...

Javascript and Performance, Use jquery or pure script?

I have a big data should be shown in a Table. I use javascript to fill the table instead of priting in HTML. Here is a sample data I use: var aUsersData = [[1, "John Smith", "...."],[...],.......]; the problem is that Firefox warns me that "There is a heavy script running, should i continue or stop?" I don't want my visitors see the...

jquery submit failure

I'm trying to submit a form by assigning submit() to a click handler in jquery. My code is currently this: $("#ics_alert_submit").click(function() { $("#ICS_upload_form").submit(); } ); where #ics_alert_submit is a button in a jquery generated modal window and #ICS_upload_form is the id and name of the form I wish to submit. I can't ...

load page into div and keep the same page in div after refresh

hello friends, I have loaded a page into div using jQuery. But when i refresh the webpage will go to initial stage? How can i load the same page after refresh? let the inital stage is $("div").load("a.htm") after clicking on a button it will load $("div").load("b.htm") now the division contains b.htm and after refreshing it is...

What is wrong with this simple jQuery code?

Hello, What is wrong with this jquery code, the error received on IE is Message: Expected ';' Line: 10 Char: 10 All I want is to move the mouse over and have an alter pop-up <script language="javascript" type="text/javascript"> $(document).ready(function() { $('#t').bind('onmouseover',function(){ target: '#t', ...

Writing Ajax Form with IF ELSE statements...where did I go wrong?

Need some help with a #jQuery issue. Can someone look at this - http://bit.ly/avGLl4 - and tell me where I went wrong? ...

Overflow hidden elements

I'm wondering how can I access overflowing elements. I would like to copy their content in to another div or something. Lets say I got a ul with 5 li elements, but only two are visible. So.. How can I get other 3 elements in another div? ...

Measure CPU load of Javascript applications

I need to measure the performance overhead of additional Javascript event bindings (using jQuery live), the overhead would probably increase CPU load and be very hard to notice from execution time profiling. How can I measure the CPU load differences between two different versions of a Javascript application? ...

how to run my own jQuery function correctly?

I've got this code that's changing a picture and additional link with it. var imgSwap(pic, link){ $("#sampleimg") .load(function () { $(this).hide(); $('#indexPic').removeClass('loading'); $(this).fadeIn(500); }) .error(function () {}) .attr({src : picArray[5]});...

Why is this code slower in Firefox?

<input type="text" id="sShState" /> $('#sShState').liveSearch(); // A plug-in // inside plug-in: $this = $(this); // On focus I add a dropdown box and add li's; var obj = '<ul id="ddList"></ul>'; $this.after(obj); $this.next('ul').html(li's); $('#ddList').live('mouseenter', function(){ var $li = $this.next('ul').children('li'); ...

jQuery sifr plugin (thewikies.com) and IE

Hi, Is someone able to use jQuery sifr plugin, from thewikies.com, with Internet Explorer ? I reduce code to minimum : <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd"&gt; <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=8"> <meta http-equiv="Content-Type" content="text/html; ch...

How do I build C# asp.net ajax wizard (or rather convert a PlaceHolder based wizard)

I have looked at similar questions and cant seem to get the answer I need. We have a Webform based asp.net application with Wizard based interfaces. These vary between 2 to 5 steps where each step may be reliant on the previous one, ie populated before the user sees it. The Wizards are based on hiding and showing PlaceHolder controls fo...