jquery

Call PHP page via jQuery/Ajax

Let's say I have a PHP page and inside that PHP page I just have <?php echo "Hello World!"; ?> and I want to use JavaScript (preferabbly jQuery) and AJAX to CALL that php page and return it's output (which would be "Hello World!") How is this done? ...

jquery change event doesn't fire if field was previously focus()ed in IE8

I have the following: $('document').ready(function () { $('.autosubmit').change(function () { $(this).closest('form').submit(); }); $('#textBox1').focus(); }); If I don't have the focus() line, then everything works as expected, the data in the textbox with ID "textBox1" changes, focus is lost ...

jQuery ajax call stops when a download prompt is shown

In the code below I use the jQuery ajax() function to do a longpolling call. While the ajax function is running, I click on the link to download Firefox (for example) and the ajax call stops. It actually acts like the call was succesful, but it wasn't, it simply stopped running. Why is that? I want to function to continue... I have s...

Stopping the video if the rotate is moving

Ok so i have this page. As you can see on this page I have a header that if you click on the three little dots on the right a new image and movie is displayed. this works great at the moment. The problem is the client now wants the page to rotate and I have tried this in the past but the problem arises when someone clicks on the movie an...

JQuery Plugin: calling jConfirm from asp.net (code behind)

i am using jquery plugin and i got stuck in how to display the confirmation window from code behind and if the user choose "ok" than go ahead delete otherwise ignore. jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) { jAlert('Confirmed: ' + r, 'Confirmation Results'); }); anybody have done similar? ...

How do I select all the values of a table with jQuery?

Hi, I have this: $(document).ready(function() alert($("td").val()); }); But the alert is empty. How do I select the values in my table with jQuery? Thank you. edit: I was asked what for: I have a website that I need the database data from for a javascript function. I get the data from the database, put it a table and then se...

Login and stay on the same page?

I'm trying to make a sleek login function here =) I want the "login experience" to be smooth and seamless, so I don't want the user to "feel" like he/she is being "redirected" and taken back to the same page again. So the process goes: User X visits page A X is not logged in X presses on Login btn (that lives in a in a div together w...

What's the best way to play a sound from my website?

I know it's generally frowned upon, but in this case I think it might actually be helpful. I want to play a little "ding" sound when a new item is posted on my site. I'll leave the option to turn it off of course. Now should I do this with JavaScript? Would jQuery be helpful? Or should I use Flash? Looking for something that is widely c...

ASP.NET MVC2 User Control JQuery problem

Hi! I want to make my own authorization for my asp.net mvc2 application, I want to use the default LogOn user control, I add this code to user control: <a id="log_in" href="#">log in</a> <div id="dialog" title="Please sing in"> <p>Login:</p> <p><input type="text" /></p> <p><input type="text" /></p> ...

jQuery returns null for element height? why?

hey guys, $(document).ready(function(){ function getDocumentHeight() { // What's the page height? var height = $('#mainbody').height(); alert(height); ... getDocumentHeight(); jQuery keeps alerting "null" for the height of my #mainbody div. i don't get why, it should at least be 500px or so. thank you. ...

Javascript - How do I declare a variable with the variable name based on a string?

var cur_storage_unit = $('#storage_unit').val(); $('.size_unit').change(function() { var id = $(this).attr('id'); //This is how I want it to work, but not sure how 'cur_' + id = $(this).val(); }); The user 'changes' a of class 'size_unit' and id of 'storage_unit'. I want to then set the value of 'cur_storage_unit' to the...

How to post form using jQuery?

I have a form with a submit button and it works fine, but I now have a user request to make the form get saved (posted to save action) if a link on the page is clicked and the form is "dirty". I've got the logic in place by having an isDirty JavaScript variable, now I would like to post the form from the JavaScript function when it is d...

100% clientside jquery shoppingcart

I know clientside webcarts could be modified by the visitor, in my application that is OK. The only webacart without serverside logic and validation I have found is simplecart-js. However it is not using jquery. Can anyone suggest a jquery cart with the same functionalities, or even more basic? I assume it would make use of the ezcookie...

there is something wrong with this Jquery post?

im trying to pass on the id attribute to the file.php, but its giving me 0 every time, when i try to insert it into the database, the javascript and the html is provided! $(function() { $(".follow").click(function(){ var element = $(this); var I = element.attr("id"); var info = 'id=' + I; $.ajax({ ...

Confirm browser back button else stay on page

In javascript or jquery I need to add an alert when the user clicks on the browser back button that has an ok/cancel button model, but instead of "Ok" it should say Leave and instead of Cancel it should say Stay. Thanks ...

Has anybody used any jquery dialog boxes with the colorbox plugin

I want to open a dialog box from inside colorbox. Which dialog plugin works well within colorbox? ...

Is there a jQuery technique to select all the page controls/divs with a non-zero scrollbar position?

Is there a jQuery technique to select all the page controls/divs with a non-zero scrollbar position? I'm trying to solve a problem faced by many; essentially after a partial asp.net postback all the controls/divs that had a scrollbar with a non-zero value (ie: were scrolled down to some position) are reset to the zero (top of the scroll...

JQuery, adding row but no effect on className

I am trying to add a row to existing table by using clone() method. It is working fine and I also want to change CSS class name for all div elements under each td from the original row. Basically I want to make some td elements as editable. I have tried this by adding "row.find("td div")..." as you see in the code, but this code has no e...

jQuery toggle running twice

It seems that this code: $(function(){ $('.show_hide_login').toggle( function (){ alert('show'); $("div#fullpage").show(); $("div#loginbox").show(); }, function (){ alert('hide'); $("div#loginbox").hide(); $("div#fullpage").hide(); } ); }...

Get the html that makes up an element reference?

Hey, Does anybody know, if i have an object like $('#input') how can I get the html that would make it up, like <input id="input" /> as a text string? Thanks! ...