Search Results

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

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

  • jQuery ajax callback function not working

    - by Harish Kurup
    I am using Symfony PHP Framework to create web application, and using symfony Forms to create the HTML forms. I am trying to load the data in Select element using Ajax, for that i am using jQuery's Ajax functions. It is working fine as it sends and gets the response correctly(status as 200), but not calling the Callback function in some browsers such as IE,Chrome and Safari.It works fine in Firefox and Opera. the Code that is not working, $.ajax({ type: 'POST', url: 'form/ajax', async: true, cache: false, dataType : 'json', data: 'id='+ids, success: function(jsonData){ alert("ok go"); } }); the alert "OK Go" is not called in Chrome,IE and Safari But $.ajax({ type: 'POST', url: 'form/ajax', async: true, cache: false, dataType : 'json', data: 'id='+ids, success: alert("ok go"); }); this works, but as per the project i want the JSON data to load in my Select element. is there any thing wrong in the return JSON format or the bug in the jQuery Ajax functions, please help.

    Read the article

  • bing maps in jquery dialog context menu

    - by lucky
    I have a main form, which has button. By clicking on this button JQuery Dialog will shown. And contains of this dialog is a javascript bing map (using VEMAP object). So there are different js documents. How can I create a context menu for bing map, opening in jquery dialog? Thanks!

    Read the article

  • Hold i ajax call in every minute calling section

    - by gowri
    i am calling ajax every second in page.. Here the server page returns randomly generated number,using this number(converted into seconds) i am triggering another function in ajax success .it works My problem suppose random number = 5 means trigger() function called after 5 seconds using setTimeout,but rember ajax call is triggering every 1 second so trigger function also called many time. i want to make ajax call wait untill trigger function execution.Which means i wanna pause that ajax call untill 5 seconds after that resume How can i do this ? My coding //this ajax is called every minute $.ajax({ type: "POST", url: 'serverpage', data: ({pid:1}), success: function(msg) { var array = msg.split('/'); if(array[0]==1){ setTimeout(function() { trigger(msg); },array[1]+'000'); } } }); //and my trigger function function trigger(value) { alert("i am triggered !"); } server response maybe 1/2 or 1/5 or 1/ 10 or 1/1 here 1/3(this is converted into seconds)

    Read the article

  • How to load an ajax (jquery) request response progressively without waiting for it to finish?

    - by Sebastian
    I want to make a form that will use jquery to submit a list of keyword to a php file, this file could take a lot of time to load depending on the size of the keywords list. What I want to do is to load the php response into a div or container in real time without using iframes. All the ajax request I know have to wait until the request has finished before having access to the response, I need to get access to that response even when it hasn't finished so I can update the progress in real time.

    Read the article

  • jquery ui tabs redirecting to ASPX page on postbacks

    - by neoneo007
    I am being redirected to the actual aspx page when I submit the form. How to avoid the redirection. Tabs.aspx <div id="container-1"> <ul> <li><a href="Survey.aspx?group=1"><span>HR</span></a></li> <li><a href="Survey.aspx?group=2"><span>Sales</span></a></li> <li><a href="Survey.aspx?group=3"><span>Finance</span></a></li> </ul> jquery code in tabs.aspx <script type="text/javascript"> $(function() { $('#container-1 > ul').tabs(); </script> Survey.aspx <form id="form1" runat="server"> <div> <asp:Label ID="lblHeading" runat="server"></asp:Label><br /> <asp:HiddenField ID="hdnGroupId" runat="server" /> <br /> 1) Question 1 <asp:DropDownList ID="DropDownList1" runat="server"> </asp:DropDownList>     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /> 2) Another question:  <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br /> <br /> <br /> <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" /><br /> <div id="Result">Click here for the time.</div> <asp:Label ID="lblMessage" runat="server"></asp:Label></div> </form> Survey page Code behind protected void btnSave_Click(object sender, EventArgs e) { if (groupId > 0) { switch (groupId) { case 1: lblMessage.Text = "HR data is saved."; break; case 2: lblMessage.Text = "Sales data is saved."; break; case 3: lblMessage.Text = "Finance data is saved."; break; default: break; } } }

    Read the article

  • jquery multiple ajax check for all done? (order not important)

    - by second
    Is there a neat way to make sure a bunch of ajax callbacks have all finished? They don't need to be executed in order, i just need all the data to be there. one idea is to have them all increment a counter on completion and check if counter == countMax, but that seems ugly. Also, are there sync issues? (from simultaneous read/write to the counter)

    Read the article

  • Jquery Ajax Call In For Loop Only Runs Once - Possible Issue with Timing & Exit Condition?

    - by Grumps
    Background I'm building a form that uses autocomplete against the EchoNest API. First the users picks an artist, using the Artist Suggest call. Next they select a song but the Song and/Or Artist song search doesn't provide a "wild card" search. It only returns exact matches. So based on the forums they suggest building an array of the songs and using auto complete on the array. I can only get a maximum of 100 responses at a time. I do know based on the initial response the number of songs. My Plan: Wrap the ajax call in a for loop ('runonceloop'). Amend the loop exit condition after the first response with the total number of songs. Challenge I'm having: The 'runonceloop' only completes a singe loop because or at least that's what I believe: The exit condition is satisfied before the first response [1] is received. I've tried to adjust the 'exit condition' and 'counter' such that they are set and and increased at the end of the success block. This seems to lock up my browser. Can someone provide some guidance on this situation?[2] I'd really appreciate it. I also don't think turning async off is a good idea because it locks the browser. Response[1]: { "response": { "status": { "code": "0", "message": "Success", "version": "4.2" }, "start": 0, "total": 121, //Used for "songs": [ { "id": "SOXZYYG127F3E1B7A2", "title": "Karma police" }, { "id": "SOXZABD127F3E1B7A2", "title" : "Creep" } ] } } } Code[2] var songsList = []; function getSongs() { var numsongs = 2; //at least 2 runs. var startindex = 0; runonceloop: //<~~~~Referenced in question for (var j = 0;j >= numsongs;) { console.log('numsongs' + numsongs); $.ajax({ url: "http://developer.echonest.com/api/v4/artist/songs", dataType: "jsonp", data: { results: 100, api_key: "XXXXXXXXXXX", format: "jsonp", name: $("#artist").val(), start: startindex }, success: function (data) { var songs = data.response.songs; numsongs = data.response.total; //modify exit condition for (var i = 0; i < songs.length; i++) { songsList.push(songs[i].title); } j +=100;// increase by 100 to match number of responses. } }); }};

    Read the article

  • Optimizing jQuery for Tabs

    - by jpdbaugh
    I am in the process of developing a widget. The widget has three tabs that are implemented in the following way. <div id="widget"> <ul id="tabs"> <li><a href="http...">One</a></li> <li><a href="http...">Two</a></li> <li><a href="http...">Three</a></li> </ul> <div id="tab_container"> <div id="tab_content"> //Tab Content goes here... </div> </div> </div> // The active class is initialized when the document loads $("#tabs li a").click(function() { $("#tabs li.active").removeClass("active"); $("#tab_content").load($(this).attr('href')); $(this).parent().addClass("active"); return false; }); The problem I am having is that the jquery code that have written is very slow. If the user changes tabs quickly the widget gets behing and bogged down. This causes the tabs to to not align with the data being displayed and just general lag. I believe that this is because the tab is being changed before $.load() is finished. I have tried to implement the following: ("#tabs li a").click(function() { $("#tabs li.active").removeClass("active"); $("#tab_content").load($(this).attr('href'), function (){ $(this).parent().addClass("active"); }); return false; }); It is my understanding that the callback function within in the load function does not execute until the load function is completed. I think this would solve my problem, however I can not come up with a way to select the correct tab that was clicked within the callback function. If this is not the way to do this then what is the best way implement these tabs so that they would stop loading an old request and load the newest tab selection by the user? Thanks

    Read the article

  • jQuery UI datepicker customization

    - by Chad
    I have the jQuery datepicker working, but I need to be able to select more than just dates. I need to be able to select between some strings as well "Yesterday" and "Today" to be precise. So, the underlying input can contain any date as well as the strings "Yesterday" or "Today". Is there some way I can do this by tweaking the existing jQuery UI datepicker?

    Read the article

  • jquery tabs with form help

    - by sico87
    Hello, I am implementing jQuery tabs on mysite, one of the tabs holds a form and this is my problem, the form is loaded in via ajax as it is used multiple time throughout the site. My issue is that when the form is submitted the page leaves the tabbed area, whereas I need to stay within the tabbed system. Below is the code I am using TABS HTML <div id="tabs"> <ul> <li><a href="#tabs-1">Active Categories</a></li> <li><a href="#tabs-2">De-activated Categories</a></li> <li><a href="<?=base_url();?>admin/addCategory">Add A New Category</a></li> </ul> FORM MARKUP <div id="contact_form"> <?php // open the form echo form_open(base_url().'admin/addCategory'); // categoryTitle echo form_label('Category Name', 'categoryTitle'); echo form_error('categoryTitle'); $data = array( 'name' => 'categoryTitle', 'id' => 'categoryTitle', 'value' => $categoryTitle, ); echo form_input($data); // categoryAbstract $data = array( 'name' => 'categoryAbstract', 'id' => 'categoryAbstract wysiwyg', 'value' => $categoryAbstract, ); echo form_label('Category Abstract', 'categoryAbstract'); echo form_error('categoryAbstract'); echo form_textarea($data); // categorySlug $data = array( 'name' => 'categorySlug', 'id' => 'categorySlug', 'value' => $categorySlug, ); echo form_label('Category Slug', 'categorySlug'); echo form_error('categorySlug'); echo form_input($data); // categoryIsSpecial /*$data = array( 'name' => 'categoryIsSpecial', 'id' => 'categoryIsSpecial', 'value' => '1', 'checked' => $checkedSpecial, ); echo form_label('Is Category Special?', 'categoryIsSpecial'); echo form_error('categoryIsSpecial'); echo form_checkbox($data);*/ // categoryOnline $data = array( 'name' => 'categoryOnline', 'id' => 'categoryOnline', 'value' => '1', 'checked' => $checkedOnline, ); echo form_label('Online?', 'categoryOnline'); echo form_checkbox($data); echo form_error('categoryOnline'); //hidden field check if we are adding or editing echo form_hidden('edit', $edit); echo form_hidden('categoryId', $categoryId); // categorySubmit $data = array('class' => 'submit', 'id' => 'submit', 'value'=>'Submit', 'name' => 'categorySubmit'); echo form_submit($data); echo form_close(); ?> </div> FORM PROCESS function saveCategory() { $data = array(); // we need to set the what element the form errors get displayed in $this->form_validation->set_error_delimiters('<div class="formError">', '</div>'); // we need to estabilsh some rules so the form can be submitted without error, // or if there is error then the form needs show errors. $config = array( array( 'field' => 'categoryTitle', 'label' => 'Category title', 'rules' => 'required|trim|max_length[25]|xss_clean' ), array( 'field' => 'categoryAbstract', 'label' => 'Category abstract', 'rules' => 'required|trim|max_length[150]|xss_clean' ), array( 'field' => 'categorySlug', 'label' => 'Category slug', 'rules' => 'required|trim|alpha|max_length[25]|xss_clean' ), /*array( 'field' => 'categoryIsSpecial', 'label' => 'Special category', 'rules' => 'trim|xss_clean' ),*/ array( 'field' => 'categoryOnline', 'label' => 'Category online', 'rules' => 'trim|xss_clean' ) ); $this->form_validation->set_rules($config); // with the validation rules set we can no run the validation rules over the form // if any the validation returns false then the error messages will be returned to the view // in the delimiters that we set further up the page. if($this->form_validation->run() == FALSE) { // we should reload the form $this->load->view('admin/add_category'); } }

    Read the article

  • jquery ajax html response change 1.3.2 vs 1.4.2 (aka where is my script tag?)

    - by cmroanirgo
    I've been using jquery 1.3.2 to pull snippets of html (including script) from a server. A typical response might be: <div id="content"<div id="inner"... <script type=... alert("hello world");</script <pHello World</p </div</div I've been using the query .get function: $.get($(this).attr("href"), function(response) { $("#inner").replaceWith($("#inner", response)); }); And everything is fine and works as expected: the returned html snippets get loaded into the DOM and the scripts run. When I use 1.4.2 however, I notice that the script tags have been removed and no longer run. Stepping into the newer jquery codebase yields the lines of code (line 4498) : ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); which seems to be the culprit 'removing' the script from its happy resting place as part of the selector process. But it doesn't help me in injecting exactly what i want into the DOM. Any idea why jquery is doing this? More importantly, how can I go about fixing this so that my scripts run?

    Read the article

  • Getting browser to make an AJAX call ASAP, while page is still loading

    - by Chris
    I'm looking for tips on how to get the browser to kick off an AJAX call as soon as possible into processing a web page, ideally before the page is fully downloaded. Here's my approximate motivation: I have a web page that takes, say, 5 seconds to load. It calls a web service that takes, say, 10 seconds to load. If loading the page and calling the web service happened sequentially, the user would have to wait 15 seconds to see all the information. However, if I can get the web service call started before the 5 second page load is complete, then at least some of the work can happened in parallel. Ideally I'd like as much of the work to happen in parallel as possible. My initial theory was that I should place the AJAX-calling javascript as high up as possible in the web page HTML source (being mindful of putting it after the jquery.js include, because I'm making the call using jquery ajax). I'm also being mindful not to wrap the AJAX call in a jquery ready event handler. (I mention this because ready events are popular in a lot of jquery example code.) However, the AJAX call still doesn't seem to get kicked off as early as I'm hoping (at least as judged by the Google Chrome "Timeline" feature), so I'm wondering what other considerations apply. One thing that might potentially be detrimental is that the AJAX call is back to the same web server that's serving the original web page, so I might be in danger of hitting a browser limit on the # of HTTP connections back to that one machine? (The HTML page loads a number of images, css files, etc..)

    Read the article

  • JQuery UI Autocomplete showing as bullets

    - by awshepard
    The JQuery UI Demo page for autocomplete (link) has a nice looking search box and drop down with nice colors and highlights and such. When I implement it for myself, I end up with a bulleted list. How do I get my drop down of suggestions to look like theirs? A few notes/code fragments: I'm working in .NET land, so I'm using the <asp:ScriptManager> tag with <asp:ScriptReference>s inside it to get the hosted jquery.min.js (1.4.2) and jquery-ui.min.js (1.8.1) files from Google. My input box is fairly simple: <div class='ui-widget'> <label for="terms">Term: </label> <input id="terms" class="ui-autocomplete-input"> </div> My autocomplete looks like: $(""#terms"").autocomplete({source:""GetAttributesJSON.aspx"",minLength:2}); I get the correct data back, so that's not the issue. I just want fancy graphics. Any thoughts would be much appreciated.

    Read the article

  • jQuery capture all changes to named inpt on a form

    - by Brian M. Hunt
    I'm trying to determine when any of a set of named input/select/radio/checked/hidden fields in a form change. In particular, I'd like to capture when any changes are made to fields matching jQuery's selector $("form :input"), and where that input is has a name attribute. However, the form isn't static i.e. some of the fields are dynamically added later. My initial thought is to keep track of when new named elements matching :input are added, and then add an event handler, like this: function on_change() { alert("The form element with name " + $(this).attr("name") + " has changed"); } function reg_new_e_handler(input_element) { input_element.change(on_change); } However, I'm quite hopeful I can avoid this with some jQuery magic. In particular, is there a way to register an event handler in jQuery that would handle input elements that match the following: $("form :input").filter( function () { $(this).attr("name") } ).change(on_change); However, have this event set update whenever new input elements are added. I've thought that it may be possible to capture keyup event on the form node with $("form").keyup(on_change), but I'm not so sure how one could capture change events. I'd also like this to capture keyup events. Thank you for reading. Brian

    Read the article

  • JQuery UI Tabs - replace tab and contents

    - by Tauren
    What is the best way to replace the currently selected tab and its contents? The content is dynamically generated with jquery, not loaded via a URL. I need to do this from outside of any tab code or tab event handler (show, add, etc.). There is a link elsewhere on the page that should do the following when clicked: Change the tab's title Change the tab's className Clear out all elements of the tabcontent div Change the tabcontent div's className Generate new content inside the tabcontent div Note that the only reference this link's click() handler has is to the JQuery tabs object ($Tabs). I can get the selected tab with $Tabs.tabs('option','selected'). But how can I get a reference to the selected tab's tab and panel? Inside of a jquery tab handler (show, add, etc.), I have access to ui.tab and ui.panel, but is there a way to get them from a tabs option? Would it be better to simply remove the currently selected tab and then add a new tab in the same index location? I'd have to put the code to generate the tab content into the add() handler then I suppose.

    Read the article

  • Jquery Template textbox not showing datepicker

    - by pirzada
    I am using Datepicker on one of the the textbox in Jquery template but its not popping up. Outside of the template working fine. Below is what I want to do. jQuery().ready(function () { //$("#HireDate").datepicker(); $("#HireDate").datepicker({dateFormat:'dd-mm-yy', showAnim:'fadeIn'}) }); <script id="UserDetailTemplate" type="text/x-jquery-tmpl"> <table style="width:100%;"> <tbody> <tr> <td style="width:25%;font-weight:bold;">HireDate:</td> <td><input type="text" id="HireDate" value="${ HireDate }" /></td> </tr> </table> </td> </tr> </tbody> </table> </script>

    Read the article

  • Combining the jquery Calendar picker with the jquery validation and getting them to play nice?

    - by MBonig
    I'm just starting to get into jquery/javascript programming so this may be a beginner question but I sure can't seem to find anything about it. I have a text field on a form. I've used the JQuery UI Calendar picker to make data entry better. I've also added jquery validation to ensure that if the user enters the date by hand that it's still valid. Here is the html: <input class="datepicker" id="Log_ServiceStartTime_date" name="Log_ServiceStartTime_date" type="text" value="3/16/2010"></input> and javascript: $('form').validate(); $('#Log_ServiceStartTime_date').rules('add','required'); $('#Log_ServiceStartTime_date').rules('add','date'); the problem I'm having is this: If a user puts in a bad date, or no date at all, the validation correctly kicks in and the error description displays. However, if the user clicks on the textbox to bring up the calendar picker and selects a date, the date fills into the field but the validation does not go away. If the user clicks into the textbox and then back out, the validation correctly goes away. How can I get the calendar picker to kick off the validation routine once a date is selected? thanks

    Read the article

  • Confusion: Ajax Framework vs JavaScript Framework ?

    - by Rachel
    I was under the impression that jQuery is JavaScript Framework, but when am searching for AJAX Framework it appears that jQuery is also being suggested as best AJAX Framework. Reference: Best Ajax Framework My Question: What is Ajax Framework and how it is different from JavaScript Framework like jQuery ? What are best known Ajax Framework ? What are best known JavaScript Framework ?

    Read the article

  • jquery ajax call in onsubmit function is not working

    - by shilna mk
    I have form submission page add_sale.php and an ajax page ajx_check_sale.php.Ajax call is inthe onsubmit function.But ajax is not worikng.Anybody give any solution plz.. I have form submission page add_sale.php and an ajax page ajx_check_sale.php.Ajax call is inthe onsubmit function.But ajax is not worikng.Anybody give any solution plz.. add_sale.php function sale_credit(id) { var cust_name=$('#cust_name').val(); $.ajax({ type: "POST", url: 'ajx_typ1.php', data:'id='+id, success: function(msg) { $("#sale_type1").html(msg); } }); $.ajax({ type: "POST", url: 'ajx_typ3.php', data:'id='+id, success: function(msg) { $("#sale_type3").html(msg); } }); $.ajax({ type: "POST", url: 'ajx_typ2.php', data:'id='+id, success: function(msg) { $("#sale_type2").html(msg); } }); } function validate_form() { var cust_name= $('#cust_name').val(); var total= $('#total').val(); var sale_type= $('#sale_type').val(); if(sale_type=='return') { $.ajax({ type: "POST", url: 'ajx_check_sale.php', data:'cust_name='+cust_name + '&total=' + total, success: function(msg) { alert(msg); /*if(msg==0) { alert("Return is greater then sale"); return false; } */ } }); } } <form action="" method="post" name="adFrm" onSubmit="return validate_form()"> <select name="sale_type" style="width:130px;" id="sale_type" onchange="sale_credit(this.value)" > <option value="">Select</option> <option value="credit">Credit</option> <option value="payment">Payment</option> <option value="return">Return</option> </select> </form> ajx_check_sale.php require_once("codelibrary/inc/variables.php"); require_once("codelibrary/inc/functions.php"); echo $cust_name=$_POST['cust_name']; echo $return=$_POST['total']; $cus="select sum(total) as total_sum from customer where id='$cust_id'"; $cus2=mysql_query($cus); $fet=mysql_fetch_array($cus2); $total=$fet['total_sum']; if($return>$total) { $status=0; echo $status; } else { $status=1; echo $status; }

    Read the article

  • What are the options for simple Ajax calls for a Java webapp?

    - by Cedric Martin
    I've got a very simple need and I don't know what are the options available. If I simplify, users see webpage like this server by a Java webapp server: [-] red [x] green [-] blue [-] yellow The selected color is green And then I want the user to be able to select the yellow color and have the part of the page containing the relevant text change to: [-] red [-] green [-] blue [x] yellow The selected color is yellow Basically I want something a bit more user friendly than simply using HTTP GET all the time. There shall be a lot of options the user can select from and this shall affect an (HTML formatted) text displayed on the page. And I want the user to see his change as soon as possible, without having the page to fully reload and without being redirected to another page. There shall be a client/server round-trip (the information to display depending on the options selected ain't available on the client-side so I cannot do it all in JavaScript in the browser). I'd like to use Ajax requests but I don't know which way to go: jQuery GWT something else What are my options and what would be the pros and cons of the various approach? P.S: I'm very familiar with Java (SCP since the last century and basically being a Java programmer for the last 12 years or so) but not familiar at all with JavaScript (though I did hack a few Ajaxy-calls years ago, way before great libraries existed).

    Read the article

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