Search Results

Search found 21127 results on 846 pages for 'jquery ajax'.

Page 14/846 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • jQuery scrollTop not working in chrome but working in Firefox

    - by Maju
    I have used a scrollTop function in jquery for navigating to top. But strangely 'The smooth animated scroll' stopped working in safari and chrome(scrolling without smooth animation) after I made some changes. But it is working smoothly in Firefox. What could be wrong? Here is the jquery function i used, jQuery $('a#gotop').click(function() { $("html").animate({ scrollTop: 0 }, "slow"); //alert('Animation complete.'); //return false; }); HTML <a id="gotop" href="#">Go Top </a> CSS #gotop { Cursor: pointer; position: relative; float:right; right:20px; /*top:0px;*/ }

    Read the article

  • Listening and firing events with Javascript and maybe jQuery

    - by at
    In my Javascript and Flex applications, users often perform actions that I want other Javascript code on the page to listen for. For example, if someone adds a friend. I want my Javascript app to then call something like triggerEvent("addedFriend", name);. Then any other code that was listening for the "addedFriend" event will get called along with the name. Is there a built-in Javascript mechanism for handling events? I'm ok with using jQuery for this too and I know jQuery makes extensive use of events. But with jQuery, it seems that its event mechanism is all based around elements. As I understand, you have to tie a custom event to an element. I guess I can do that to a dummy element, but my need has nothing to do with DOM elements on a webpage. Should I just implement this event mechanism myself?

    Read the article

  • Jquery Live Validation

    - by sico87
    Hello Everyone, After having a search around I could not find exactly what I want, I am looking to validate a form client side using the Jquery library and some form of validation plugin. I was hoping that some one could advise me on whether there are any validation plugins out there that do not use generic error messages, as my form is laid out with no room for these errors, and I also I want the validator to to for correct content as well. Basically I want to be able to check the field on each key press and blur and if the fields validates for it to gain a green border, and if it does not validate for it to gain a red border, any one know of a plugin that can do this? Thanks sico87

    Read the article

  • jQuery validate + ajaxSubmit on multiple forms

    - by demogar
    Hello there. I'm trying to validate multiple forms in one single page with the jQuery validation plugin but it validates only the first form in the page. Here is my code: $('form.reply_form').validate({ submitHandler: function(form) { $(form).ajaxSubmit(optionsReplies); return false; } }); Is for a list of reply forms in the page (image facebook). If I try to use the third form, for example, it validates the first one and if the first one is blank it wont submit. Thank you in advance.

    Read the article

  • Use jQuery Fancybox(lightbox type dialog) with dynamically loaded links

    - by Pjack
    I'm trying to bind Fancy box links so that when the new links are created it will still work. I've seen a few other question on here but not really answered. This is what I'm trying to do. jQuery("a#[id^='domore_']").fancybox({ 'autoDimensions' : false, 'width' : 'auto', 'height' : 'auto' }); This works fine but when the page or links are reloaded by ajax it doesn't work. I tried using live() but I couldn't get it to work. How do you rebind or implement live on fancybox? Any way to do this? Thanks

    Read the article

  • setting min date in jquery datepicker

    - by user1184777
    Hi i want to set min date in my jquery datepicker to (1999-10-25) so i tried the below code its not working. $(function () { $('#datepicker').datepicker({ dateFormat: 'yy-mm-dd', showButtonPanel: true, changeMonth: true, changeYear: true, showOn: "button", buttonImage: "images/calendar.gif", buttonImageOnly: true, minDate: new Date(1999, 10 - 1, 25), maxDate: '+30Y', inline: true }); }); ** if i change the min year to above 2002 than it will work fine but if i specify min year less than 2002{like above eexample 1999} it will show only up to 2002.can someone help me. i am using jquery-1.7.1.min.js and jquery-ui-1.8.18.custom.min.js.

    Read the article

  • jquery sortable problem with ie

    - by corroded
    i am using jquery to sort my lists and i have run into a dead end. First, I checked the jquery site if theirs work on ie7, thats great, it does. next, i checked mine without the styles(so there possibly wont be anything that's intercepting or affecting jquery stuff). but i still get this weird error in ie7 when you sort items in the inner list(i have nested lists) they overlap each other, destroying the layout. if you sort the contianer lists, they work fine! here's a jsfiddle of what i mean: http://jsfiddle.net/GDUpa/ note that if you drag demonstration one or two spots(in ie), it will overlap with the other links. BUT if you drag POC (it will select the whole thing including the links under it), it works fine! is something wrong with my markup?

    Read the article

  • Extending a jquery plugins event callback

    - by Greg J
    I'm extending the functionality of a jquery plugin (foo) with another jquery plugin (bar). Essentially, the first plugin specifies an onReady(): var foo = $.foo({ onReady: function() { alert('foo'); }}); Foo is sent to bar as a parameter to bar: var bar = $.bar(foo); I want bar to be able to hook into foo's onReady event: (function($) { $.extend({ bar: function(foo) { var foo = foo; // How to do alert('bar') when foo.onready is called? } }); })(jQuery); I can override foo's onready event: foo.onready = function() { alert('bar'); } But I don't want to override it, I want to extend it so that I'll see both alerts when foo is ready. Thanks in advance!

    Read the article

  • jquery validation

    - by Chandrasekhar
    I am adding the dynamic text boxes when click the add link. I want to do the remote validation for dynamic text boxes. Please see the code below: <input type="text" name="test" id="test1" /> click on add button var sc ="<td><input type = 'text' name ='test' id ='test"+(textid+1)+"'/></td> document.getElementById("row1-"+textid).innerHTML=sc; Creating the 4 text fields in same way. I am validating this text fields using jQuery like $("#testSearchForm").validate({ rules: { "test": { required:true, remote: "chkvalue.action" } Required validation is working fine but remote method validation is not working. Can anyone make a suggestion?

    Read the article

  • jQuery Samples

    - by dwahlin
    Here are the jsfiddle samples that John Papa and I covered in our jQuery Fundamentals workshop at DevConnections last week. These were a few of the samples we wrote on the fly (so they’re not “perfect”) using http://jsfiddle.net and wanted to share. Additional jQuery samples covering selectors, DOM manipulation, Ajax techniques, as well as sample applications can be found here. You can also view the talks John gave at the conference here.  Code and slides from my talks can be found at the following links: Building the Account at a Glance ASP.NET MVC, EF Code First, HTML5, and jQuery Application Techniques, Strategies, and Patterns for Structuring JavaScript Code Getting Started Building Windows 8 HTML/JavaScript Metro Apps If you’re interested in learning more about jQuery check out my jQuery Fundamentals course at Pluralsight.com. Using the Data Function   Using Object Literals with jQuery   Using jQuery each() with string concatenation   Using on() to handle child events   jQuery - hover   jQuery - event handling variations   jQuery - Twitter (bind, append, appendTo, each, fadeOut, $.getJSON, callback, success, error, complete)r   jQuery - attr vs prop   jQuery - Simple selectors

    Read the article

  • How to send set of data for Ajax call from jquery with php at the serverside?

    - by Vinodtiru
    I basically have to do a update of a record. I have a set of controls like textbox, list box, radio button etc. Then i have a button on click of which i need to carry all the updated data into mysql database with a ajax request without page refresh. I am using the php with codeigniter as my serverside code. On client side i am able to send the ajax request like $(document).ready(function(){ $('#users_menu').click( function(){ $('#tempdiv').load('http://localhost//web1/index.php/c1',null); } ); }); In the above code the request is placed to a server side php page where i am not able to read the values of the control values (values of textbox, listbox etc). Now this means i should be sending the list with the request. But i am not aware of how to send this request. Please help me with some details of how to send the list of values or is it possible to read the vaules some how in the serverside php code. For your information i am using codeigniter with my php. Any kind of help is appreciated. Thanks and Regards VinodT.

    Read the article

  • please clarify some aspects of AJAX with ASP.NET web forms for a beginner

    - by citrus
    Im familiar with asp.net web forms. I would now like to move on to writing web applications that use AJAX. I would like to get to the stage where I can create an app: that has "edit in place" (no page reload) where i can reorder images using drag and drop (also saves the order to DB) that has google like search suggestions while typing on the fly 1)So do I need to learn how to use AJAX.net and Jquery(my JS library of choice)? Can I make do using only AJAX.net or only Jquery? 2)As far a I know, Jquery will allow me to perform client side manipulations/actions and AJAX.net is the part that will allow me to connect some of my actions to the Server. EG. if I wanted to re-order elements using drag and drop, I would use Jquery, but in order to save the result of the re-order to the DB I would have to use AJAX.net correct? 2a)So In order to learn how to do the above Im thinking I should first learn Jquery so I know how to manipulate/ select elements, and then I can lean how to save these changes to the DB. 3)I searched the books titled "ASP.net AJAX in action" and ASP.net 3.5 AJAX, both of these books did not contain any references to "Jquery". Is this because they may be using a different JS library, or perhaps the book focuses on the AJAX user controls? I just found it confusing that 2 popular AJAX books dont make any reference to Jquery. Thanks for any help.

    Read the article

  • How to bind to another event after ajax call in jquery

    - by robert
    Hi, I'm creating a graph using flot javascript library. I have enabled clickable event and the div is binded to plotclick event. So, when a datapoint is clicked, an ajax call is made and the result is used to replace the current div. After this i need to bind the div to a new event. I tried to call bind, but it is still bound to old callback. When i call unbind and bind, the new callback is not called. var handleTeacherClick = function( event, pos, item ) { if( typeof item != "undefined" && item ) { var user_id = jQuery( 'input[name="id' + item.datapoint[0] + '"]' ).val(); jQuery.ajax({ type: 'POST', url: BASEPATH + 'index.php/ajax/home/latest', data: { "user_id": user_id }, dataType: 'json', success: function ( result ) { jQuery.plot(jQuery('#stats_prog'), result.progress_data, result.progress_options); jQuery.plot(jQuery('#stats_perf'), result.performance_data, result.performance_options); jQuery('.stats_title'). html('<span class="stats_title">'+ ' >> Chapter '+Math.ceil(item.datapoint[0])+'</span>'); jQuery('#stats_prog')./*unbind("plotclick").*/ bind('plotclick', statClickHandler ); jQuery('#stats_perf')./*unbind("plotclick"). */ bind( 'plotclick', statClickHandler ); }, }); } }

    Read the article

  • May 2011 Release of the Ajax Control Toolkit

    - by Stephen Walther
    I’m happy to announce that the Superexpert team has published the May 2011 release of the Ajax Control Toolkit at CodePlex. You can download the new release at the following URL: http://ajaxcontroltoolkit.codeplex.com/releases/view/65800 This release focused on improving the ModalPopup and AsyncFileUpload controls. Our team closed a total of 34 bugs related to the ModalPopup and AsyncFileUpload controls. Enhanced ModalPopup Control You can take advantage of the Ajax Control Toolkit ModalPopup control to easily create popup dialogs in your ASP.NET Web Forms applications. When the dialog appears, you cannot interact with any page content which appears behind the modal dialog. For example, the following page contains a standard ASP.NET Button and Panel. When you click the Button, the Panel appears as a popup dialog: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Simple.aspx.vb" Inherits="ACTSamples.Simple" %> <%@ Register TagPrefix="act" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Simple Modal Popup Sample</title> <style type="text/css"> html { background-color: blue; } #dialog { border: 2px solid black; width: 500px; background-color: White; } #dialogContents { padding: 10px; } .modalBackground { background-color:Gray; filter:alpha(opacity=70); opacity:0.7; } </style> </head> <body> <form id="form1" runat="server"> <div> <act:ToolkitScriptManager ID="tsm" runat="server" /> <asp:Panel ID="dialog" runat="server"> <div id="dialogContents"> Here are the contents of the dialog. <br /> <asp:Button ID="btnOK" Text="OK" runat="server" /> </div> </asp:Panel> <asp:Button ID="btnShow" Text="Open Dialog" runat="server" /> <act:ModalPopupExtender TargetControlID="btnShow" PopupControlID="dialog" OkControlID="btnOK" DropShadow="true" BackgroundCssClass="modalBackground" runat="server" /> </div> </form> </body> </html>     Notice that the page includes two controls from the Ajax Control Toolkit: the ToolkitScriptManager and the ModalPopupExtender control. Any page which uses any of the controls from the Ajax Control Toolkit must include a ToolkitScriptManager. The ModalPopupExtender is used to create the popup. The following properties are set: · TargetControlID – This is the ID of the Button or LinkButton control which causes the modal popup to be displayed. · PopupControlID – This is the ID of the Panel control which contains the content displayed in the modal popup. · OKControlID – This is the ID of a Button or LinkButton which causes the modal popup to close. · DropShadow – Displays a drop shadow behind the modal popup. · BackgroundCSSClass – The name of a Cascading Style Sheet class which is used to gray out the background of the page when the modal popup is displayed. The ModalPopup is completely cross-browser compatible. For example, the following screenshots show the same page displayed in Firefox 4, Internet Explorer 9, and Chrome 11: The ModalPopup control has lots of nice properties. For example, you can make the ModalPopup draggable. You also can programmatically hide and show a modal popup from either server-side or client-side code. To learn more about the properties of the ModalPopup control, see the following website: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ModalPopup/ModalPopup.aspx Animated ModalPopup Control In the May 2011 release of the Ajax Control Toolkit, we enhanced the Modal Popup control so that it supports animations. We made this modification in response to a feature request posted at CodePlex which got 65 votes (plenty of people wanted this feature): http://ajaxcontroltoolkit.codeplex.com/workitem/6944 I want to thank Dani Kenan for posting a patch to this issue which we used as the basis for adding animation support for the modal popup. Thanks Dani! The enhanced ModalPopup in the May 2011 release of the Ajax Control Toolkit supports the following animations: OnShowing – Called before the modal popup is shown. OnShown – Called after the modal popup is shown. OnHiding – Called before the modal popup is hidden. OnHidden – Called after the modal popup is hidden. You can use these animations, for example, to fade-in a modal popup when it is displayed and fade-out the popup when it is hidden. Here’s the code: <act:ModalPopupExtender ID="ModalPopupExtender1" TargetControlID="btnShow" PopupControlID="dialog" OkControlID="btnOK" DropShadow="true" BackgroundCssClass="modalBackground" runat="server"> <Animations> <OnShown> <Fadein /> </OnShown> <OnHiding> <Fadeout /> </OnHiding> </Animations> </act:ModalPopupExtender>     So that you can experience the full joy of this animated modal popup, I recorded the following video: Of course, you can use any of the animations supported by the Ajax Control Toolkit with the modal popup. The animation reference is located here: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Walkthrough/AnimationReference.aspx Fixes to the AsyncFileUpload In the May 2011 release, we also focused our energies on performing bug fixes for the AsyncFileUpload control. We fixed several major issues with the AsyncFileUpload including: It did not work in master pages It did not work when ClientIDMode=”Static” It did not work with Firefox 4 It did not work when multiple AsyncFileUploads were included in the same page It generated markup which was not HTML5 compatible The AsyncFileUpload control is a super useful control. It enables you to upload files in a form without performing a postback. Here’s some sample code which demonstrates how you can use the AsyncFileUpload: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Simple.aspx.vb" Inherits="ACTSamples.Simple1" %> <%@ Register TagPrefix="act" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Simple AsyncFileUpload</title> </head> <body> <form id="form1" runat="server"> <div> <act:ToolkitScriptManager ID="tsm" runat="server" /> User Name: <br /> <asp:TextBox ID="txtUserName" runat="server" /> <asp:RequiredFieldValidator EnableClientScript="false" ErrorMessage="Required" ControlToValidate="txtUserName" runat="server" /> <br /><br /> Avatar: <act:AsyncFileUpload ID="async1" ThrobberID="throbber" UploadingBackColor="yellow" ErrorBackColor="red" CompleteBackColor="green" UploaderStyle="Modern" PersistFile="true" runat="server" /> <asp:Image ID="throbber" ImageUrl="uploading.gif" style="display:none" runat="server" /> <br /><br /> <asp:Button ID="btnSubmit" Text="Submit" runat="server" /> </div> </form> </body> </html> And here’s the code-behind for the page above: Public Class Simple1 Inherits System.Web.UI.Page Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click If Page.IsValid Then ' Get Form Fields Dim userName As String Dim file As Byte() userName = txtUserName.Text If async1.HasFile Then file = async1.FileBytes End If ' Save userName, file to database ' Redirect to success page Response.Redirect("SimpleDone.aspx") End If End Sub End Class   The form above contains an AsyncFileUpload which has values for the following properties: ThrobberID – The ID of an element in the page to display while a file is being uploaded. UploadingBackColor – The color to display in the upload field while a file is being uploaded. ErrorBackColor – The color to display in the upload field when there is an error uploading a file. CompleteBackColor – The color to display in the upload field when the upload is complete. UploaderStyle – The user interface style: Traditional or Modern. PersistFile – When true, the uploaded file is persisted in Session state. The last property PersistFile, causes the uploaded file to be stored in Session state. That way, if completing a form requires multiple postbacks, then the user needs to upload the file only once. For example, if there is a server validation error, then the user is not required to re-upload the file after fixing the validation issue. In the sample code above, this condition is simulated by disabling client-side validation for the RequiredFieldValidator control. The RequiredFieldValidator EnableClientScript property has the value false. The following video demonstrates how the AsyncFileUpload control works: You can learn more about the properties and methods of the AsyncFileUpload control by visiting the following page: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx Conclusion In the May 2011 release of the Ajax Control Toolkit, we addressed over 30 bugs related to the ModalPopup and AsyncFileUpload controls. Furthermore, by building on code submitted by the community, we enhanced the ModalPopup control so that it supports animation (Thanks Dani). In our next sprint for the June release of the Ajax Control Toolkit, we plan to focus on the HTML Editor control. Subscribe to this blog to keep updated.

    Read the article

  • jQuery live draggable / live droppable?

    - by Henk
    Hi all, Basically there are two tables: Companies and visitors. Currently it's possible to drag visitors to companies. Works great. As soon as the drop function occurs, there are two $.post's. The first one saves the drag to the database. The second one updates the visitors, because the information constantly changes. The problem, however is that as soon as the second $.post finishes, Firebug keeps popping the following error: d(this).data("draggable") is null Which occurs in the jQuery UI file. On line 56. about 400 times or so. So basically I'm looking for a way to do live() with draggable and droppable. The .draggables are in #visitors (an ul). The droppables are in #companies (a table). Thanks! $(".draggable").draggable({ revert:true }); $(".droppable").droppable({ drop: function(ev, ui) { $(this).text($(ui.draggable).text()); $.post('planning/save_visit', {user_id: $(ui.draggable).attr('id'), company_id: $(this).attr('id'), period: $('ul.periods li.active').attr('id')}); $.post('planning/' + $('ul.periods li.active').attr('id'), {visitors:true}, function(data){ $('#visitors').html(data); }); }, hoverClass: 'drophover' });

    Read the article

  • Using $.get with jquery validation

    - by Jimmy McCarthy
    I'm trying to use the Jquery builtin validator on my page. The issue is that I have certain fields that only are required if the JobID (entered into another field) does not already exist in our database. I have a simple service which simply takes JobID and returns True or False based on whether the JobID exists, but I can't seem to get this information where I want it. Some sample code: $("#dep_form").validate({ rules: { JobID: { required: true, digits: true, minlength: 3 }, OrgName: { required: function(element) { //This field is required if the JobID is new. return $("#jobinfo").html().length==15; } } }, messages: { JobID: { required: "Enter a Job Number.", digits: "Only numbers are allowed in Job ID's.", minlength: "Job Number must be at least 3 digits" }, OrgName: { required: "Select a Practice from the dropdown list." } }, errorClass: "ui-state-error-input", errorLabelContainer: "#errorbox", errorElement: 'li', errorContainer: "#validation_errors", onfocusout: false, onkeyup: false, focusinvalid: false }; Currently, I'm using a lazy method to validate (shown above). However, I now have access to a service using the URL: var lookupurl = "/deposits/jobidvalidate/?q=" + $("#id_JobID").val() + "&t=" + new Date().getTime(); which is a page which will contain just the word True or False based on whether that given JobID exists. I've tried half a dozen different ways of setting variables and calling functions within functions and still cannot get a way to simply return the value of that page (which I've been trying to access with $.get() ) to my validator, so that required is set to true when the Job does not exist and false if the job already exists. Any suggestions? Thanks.

    Read the article

  • jquery ui drag and drop showing feedback

    - by sea_1987
    Hi there, I have some drag and drop functionality on my website, I am wanting to hightlight the area that is droppable with a chage in border color when the draggable element is clicked/starting to be dragged. If the click/or drag stops I want the border of the droppable element to change back to its origianl state, I currently have this code, but it does not work very well. $(".drag_check").draggable({helper:"clone", opacity:"0.5"}); $(".drag_check").mousedown(function() { $('.searchPage').css("border", "solid 3px #00FF66").fadeIn(1000); }); $(".drag_check").mouseup(function(){ $('.searchPage').css("border", "solid 3px #E2E5F1").fadeIn(1000); }) $(".searchPage").droppable({ accept:".drag_check", hoverClass: "dropHover", drop: function(ev, ui) { var droppedItem = ui.draggable.children(); cv_file = ui.draggable.map(function() {//map the names and values of each of the selected checkboxes into array return ui.draggable.children().attr('name')+"="+ui.draggable.children().attr('value'); }).get(); var link = ui.draggable.children().attr('name').substr(ui.draggable.children().attr('name').indexOf("[")+1, ui.draggable.children().attr('name').lastIndexOf("]")-8) $.ajax({ type:"POST", url:"/search", data:ui.draggable.children().attr('name')+"="+ui.draggable.children().val()+"&save=Save CVs", success:function(){ window.alert(cv_file+"&save=Save CVs"); $('.shortList').append('<li><span class="inp_bg"><input type="checkbox" name="remove_cv'+link+'" value="Y" /></span><a href="/cv/'+link+'/">'+link+'</a></li>'); $('.searchPage').css("border", "solid 3px #E2E5F1").fadeIn(1000); }, error:function() { alert("Somthing has gone wrong"); } }); } });

    Read the article

  • JQuery submit form and output response or error message

    - by sergdev
    I want to submit form and show message about result. update_records initializes alert_message to error message. If success I expect that its value is changed. Than update_records outputs message. But the function always alerts "Error submitting form". What is wrong with this? The code follows: function update_records(form_name) { var options = { async: false, alert_message: "Error submitting form", success: function(message) { this.alert_message = message; } }; $('#' + form_name).ajaxSubmit(options); alert(options.alert_message); } I am newbie in Javascript/JSon/Jquery and I suspect that I misunderstand some basics of mentioned technologies. UPDATE: I specified "async:false" to make execution synchronous (Is it correct?) I also tried to insert delay between following two lines: $('#' + form_name).ajaxSubmit(options); pausecomp(1000); // inserted pause alert(options.alert_message); It also does not resolve the issue Function fo pousecomp follows: function pausecomp(millis) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millis); }

    Read the article

  • jQuery: Targeting elements added via *non-jQuery* AJAX before any Javascript events fire? Beyond th

    - by peteorpeter
    Working on a Wicket application that adds markup to the DOM after onLoad via Wicket's built-in AJAX for an auto-complete widget. We have an IE6 glitch that means I need to reposition the markup coming in, and I am trying to avoid tampering with the Wicket javascript... blah blah blah... here's what I'm trying to do: New markup arrives in the DOM (I don't have access to a callback) Somehow I know this, so I fire my code. I tried this, hoping the new tags would trigger onLoad events: $("selectorForNewMarkup").live("onLoad", function(){ //using jQuery 1.4.1 //my code }); ...but have become educated that onLoad only fires on the initial page load. Is there another event fired when elements are added to the DOM? Or another way to sense changes to the DOM? Everything I've bumped into on similar issues with new markup additions, they have access to the callback function on .load() or similar, or they have a real javascript event to work with and live() works perfectly. Is this a pipe dream?

    Read the article

  • Using jQuery with form to eliminate spam

    - by Thierry-Dimitri Roy
    I have put a form on a web page where the user can send us data. Unfortunately, the webmaster does get a lot of spam through this form and the valid submissions gets buried. I have used captcha to bypass this problem. But I think that everyone would agree that captcha is a big annoyance to users. I switched to another solution: now the URL of the submit form points to null: <form id="sendDataForm" action="/null" method="post"> ... </form> And I bypass the form submission using jQuery excellent form plugin: $('#sendDataForm').ajaxForm({ url: '/ajax-data/' }); Since then, no spam has reached the webmaster, and valid comments gets through. The only drawbacks is that users without javascript cannot send us the form. But since this is on top of a javascript web application, we can safely assume that these are not valid users. My question is: in a world where 99% of users has javascript enabled (and a mechanism for those user could be build that uses captcha), why is this solution not more used? What drawback am I not seeing?

    Read the article

  • how to add jquery live to lightbox v2?

    - by Mahmoud
    Hey all I am trying to create a page that well display a gallery image, when the user clicks on any images it inlarges using lightbox v2 now after that i adding on each image a button that well submit to jcart script which well add to cart, but when the user click on the button it refreshes. so i wanted to use jquery live to submit to jcart without closing the lightbox v2 but i still dont know how to do? code used inside lightbox title is <form class="jcart" method="post" action="" name = "add" > <input type="hidden" name="id" value="".$row['pro_num']."" /> <input type="hidden" name="name" value="".$row['pro_name']."" /> <input type="hidden" name="price" value="".$row['pro_price']."" /> <input type="hidden"name="qty" size = "1" value="1" /> <br /> <input type="image" value="Submit" name="addto" src = "images/add.png" /> </form>

    Read the article

  • jQuery show "loading" during slow operation

    - by The Disintegrator
    I'm trying to show a small loading image during a slow operation with jQuery and can't get it right. It's a BIG table with thousands of rows. When I check the "mostrarArticulosDeReferencia" checkbox it removes the "hidden" class from these rows. This operation takes a couple of seconds and I want to give some feedback. "loading" is a div with a small animated gif Here's the full code jQuery(document).ready(function() { jQuery("#mostrarArticulosDeReferencia").click(function(event){ if( jQuery("#mostrarArticulosDeReferencia").attr("checked") ) { jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").removeClass("hidden"); //slow operation jQuery("#loading").hide(); } else { jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").addClass("hidden"); //slow operation jQuery("#loading").hide(); } }); jQuery("#loading").hide(); }); It looks like jquery is "optimizing" those 3 lines jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").removeClass("hidden"); jQuery("#loading").hide(); And never shows the loading div. Any Ideas? Bonus: There is a faster way of doing this show/hide thing? Found out that toggle is WAY slower. UPDATE: I tried this jQuery("#mostrarArticulosDeReferencia").click(function(event){ if( jQuery("#mostrarArticulosDeReferencia").attr("checked") ) { jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").removeClass("hidden"); //slow operation setTimeout("jQuery('#loading').hide()", 1000); } else { jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").addClass("hidden"); //slow operation setTimeout("jQuery('#loading').hide()", 1000); } }); That's what I get click on checkbox nothing happens during 2/3 secs (processing) page gets updated loading div shows up during a split second UPDATE 2: I've got a working solution. But WHY I have to use setTimeout to make it work is beyond me... jQuery("#mostrarArticulosDeReferencia").click(function(event){ if( jQuery("#mostrarArticulosDeReferencia").attr("checked") ) { jQuery("#loading").show(); setTimeout("jQuery('#listadoArticulos tr.r').removeClass('hidden');", 1); setTimeout("jQuery('#loading').hide()", 1); } else { jQuery("#loading").show(); setTimeout("jQuery('#listadoArticulos tr.r').addClass('hidden');", 1); setTimeout("jQuery('#loading').hide()", 1); } });

    Read the article

  • mouse over and ajax tooltip

    - by vichet
    I have a number of links which I would like to get some information by using ajax calls and display the information as tooltip. I have bind the function that make the ajax call with the event on mouseover of the link something like: $('#div a').bind('mouseover', function () { //sending the ajax call } everything looks/work fine except, when the user unintentionally move the mouse pointer over all the links, I saw that there are many ajax calls. so my question how can I prevent the ajax call unless the users hover the mouse pointer on the link for at least 3 or 4 seconds first.

    Read the article

  • ASP.NET MVC 2 Post AJAX from from JavaScript

    - by ANDyW
    Hi, I got control with strongly typed View, with Ajax.BeginForm(). Now I would like to change submit method from <input type="submit" id="testClick" value="Submit" /> To some javascript method DoSubmit(). What I tried is : Invoke click on that submit button Invoke submit on form ('form1').submit(), document.forms['form1'].submit() jQuery forms with ('form1').AjaxSubmit(); Create jQuery AJAX $.ajax({ type: "POST", url: $("#form1").attr("action"), data: $("#form1").serialize(), success: function() { alert("epic win!!!1!1!") }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("epic fail!") } }); All those method created normal request (not AJAX), or they didn't work. So anyone know how I can do AJAX submit "Form", from JavaScript and strongly typed mechanism (public AcrionResult MyFormAction(FormModel model); ) will work?

    Read the article

  • how to catch ajax query post error?

    - by TTCG
    I would like to catch the error and show the appropriate message if the ajax request fails. My code is like the following, but I could not manage to catch the failure ajax request. function getAjaxData(id) { $.post("status.ajax.php", {deviceId : id}, function(data){ var tab1; if (data.length>0) { tab1 = data; } else { tab1 = "Error in Ajax"; } return tab1; }); } I found out that, "Error in Ajax" is never executed when the Ajax request failed. How to handle the ajax error and show the appropriate message if it fails? Thanks very much.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >