FAQ Database Discussion Community


Identifier starts immediately after numeric literal

jquery,ajax,razor
I'm trying to get the current logged in usersID in my jquery function var userID = @User.Identity.GetUserId(); Many answers on this page say that I have to do something like \"@User.Identity.GetUserId()\" But it dont seem to work, can someone tell me how to fix it. Its for my ajax post....

Load multiple OBJ-files together with multple textures

ajax,three.js,textures
Using the many examples on ThreeJS, I'm able to load multiple OBJ files into my scene. I'm also able to load multiple images as textures. However, the textures get assigned to the objects in 'order of appearance' and therefore, sometimes the wrong image gets assigned to the OBJ files. I...

File not Uploading using Ajax in cakephp

php,jquery,ajax,file,cakephp
Am trying to upload an image using Ajax to server. I know the code to upload file using Cakephp, but first i just want to make sure that data/file is uploaded to server for sure by printing the formdata. But it seems that only the data i typed in the...

Is there a way to fire an event every time an ajax call in made in AngularJS?

javascript,ajax,angularjs,express
What I'm trying to do is every time a call to the backend is made, I want a spinner to load up with a dark overlay. I know I can do this by simply running the spinner before the call is made, but I'm working with multiple developers and I...

Getting 302 response headers from Ajax.BeginForm?

c#,jquery,asp.net,ajax,asp.net-mvc
I have a MVC action that can either return a RedirectToAction (302) or a partial view. I'm using Ajax.BeginForm and an OnSuccess handler to capture the response. My problem is, whenever a redirect response is issued, it seems something (not sure if it's a native AJAX behavior or not) is...

Multiple AJAX forms with the same ID on the same page

javascript,php,jquery,ajax,forms
I have two AJAX newsletter subscribe forms on the same page (top and bottom). Both forms have the same ID. The top form works perfectly, however I'm unable to get the alert messages to appear in the bottom form. I found this question but wasn't sure how to implement the...

No Ajax success after php-script is run

php,jquery,ajax
I have a php-script which performs a database backup of my website. This backup-script can be triggered by clicking a button on the websites' admin-panel. I'd like to have some text in the admin-panel that tells the user when the backup is ongoing and when it's complete (process takes about...

How to write .htaccess file for AJAX page

php,jquery,ajax,.htaccess
I am working on a website which i am going to develop as a CMS. So i am writing .htaccess file. page link and url working fine, but when i performing ajax request then i am getting 404 error for the url. I am placing my .htaccess file code and...

nested ajax parent completed before child had finished

jquery,ajax,json,nested
$.ajax( { type: 'POST', url: [email protected]("EkranListeleSektor")', dataType: 'json', async: false, //added async later, no changes data: { sektorID: $("#ekranSektorID").val() }, success: function (items) { $.each(items, function (i, ekranlar) { $.ajax({ type: 'POST', url: [email protected]("IlAdGetir")', dataType: 'json', data: { id: ekranlar.il }, success: function (ilAd) { strIlAd = ilAd; }, error:...

Refresh table guestbook

php,jquery,html,ajax
I'm continuing my Guestbook and I was wondering if there is a method to refresh the table when there is a new message. All posts are stored in a database and are shown in a html table: echo "<table class=\"guestbook\" cellspacing='10'>"; while($rows=mysql_fetch_array($result)) { $avatar = $Database->selectAvatar($rows['name']); $rowsAvatar=mysql_fetch_array($avatar) ?> <tr> <td...

Sending input data to a javascript file

javascript,jquery,ajax,html5,send
My following code is this: <form> <input class="inputField" type="text" required="required" pattern="[a-zA-Z]+" /> <input class="myButton" type="submit" value="Submit" /> </form> <script type="text/javascript"> $(document).ready(function () { $(".myButton").on("click", function () { var value = $(".inputField").val(); }); }); </script> I want to send to the file main.js the data after a user puts in some...

How to return value in Meteor.JS from HTTP.call “GET”

javascript,ajax,http,meteor,facebook-javascript-sdk
I'm writing a meteor method, which should return a Facebook response for HTTP.call on graph api, but HTTP.call has only a callback function to show error/response, so I can't take this data outside, and Method can not return any value. Here's my method code: loadUserFBEvents: function () { var accessToken...

Uncaught ReferenceError: is not defined onclick when using character strings

javascript,jquery,ajax,onclick
I am trying to pass a variable to the onClick function using a previously stored value. I have a database setup that searches for store locations when provided with a ZIP code. For example, the following link is generated using an ajax call after a user searches for a Zip...

How to dynamically add a row without “Requested unknown parameter” error

javascript,jquery,ajax,datatables
I am new to DataTables and I am having problems in dynamically adding a new row to the datatable. Here is my initialization: table = $("#college-list").DataTable({ 'ajax': { 'url': 'admin/get_college', 'type': 'GET' }, 'columns': [ { 'data': 'college_abbrev', "bSortable": true }, { 'data': 'college_name' , "bSortable": true }, { "mData":...

div replacing everything after it, AJAX, PHP, JAVASCRIPT

javascript,php,jquery,html,ajax
Using ajax, I'm trying to display what is being selected on a div, and it's working, but everything after the div gets replaced by the div's output. I don't know why it's happening or how to fix it. If you know, please let me know. test1.php <?php include('ajax.php'); echo "<select...

Rails - page is not loading after submitting form through ajax

javascript,jquery,ruby-on-rails,ajax
I have a form in which i am using ajax validation, for that i have made the form as :remote => true and the view is given as <%= nested_form_for @interview_round, :remote => true do |f| %> <div id="error-div"> </div> <%= f.text_field :interviewer_name %> <%= f.text_field :log_skill, :id=>'hint-log' %> <%=...

Use a call Ajax to send an Array of string to mvc Controller

javascript,jquery,arrays,ajax,asp.net-mvc
i'm trying to get the values from the a table column, I put it in an array then send it to my controller. Something very strange happens, you'll see below : Here is my JS code : var result = []; $('td:nth-child(' + columnNbr + ')').each(function () { var t...

JQuery Operator Got Wrong Value

javascript,php,jquery,ajax
i have jquery script with operator minus, but i got wrong values, this is my code var fuid = $(this).attr("data-delete-id"); var hargaProduk = parseInt($("#harga_"+fuid).text()); var hargaTotal = parseInt($("#total-harga").text()); var newValue = hargaTotal - hargaProduk; $("#total-harga").html(newValue); And this is my HTML Code // foreach in here <tr id="table_1"> <td>Data 1</td> <td>Rp...

attempting to alter data via POST and ajax in django not working

jquery,ajax,django,post
I want to be able to click a button that will change data using ajax (jquery). Here is what I am doing now: html/js: <button onclick="alterData('some sort of data')">click me!</button> function alterData(someInput){ $.ajax({ type: 'POST', url: '/home/alter/', data: {someInput: someInput}, }); } urls.py: urlpatterns = [ ... url(r'^alter/',views.alter), ... ]...

Storing result from FOR loop as one array (array only saves each results seperately)

javascript,jquery,arrays,ajax
I have tried searching but can't find anything to help, maybe my problem is too simple! Anyway, I'm running an ajax request. The data given to the request is an array. Here is my code: var id = "1#2#3#4#5#"; var chkdId = id.slice(0, -1); var arr = chkdId.split('#'); var checkedId...

Ajax PHP file upload mistake

php,ajax,multipartform-data
I have this code in client side: fileUpload: function monkey(){ var file = t.gI("photoFile"); //get element by photoFile var formData = new FormData(); console.log(file.files.length); formData.append("upload", file.files[0]); var req = t.gR(); //XMLHTTPRequest req.open('POST', 'php/fileupload.php', true); req.setRequestHeader("Content-Type", "multipart/form-data", true); req.send(formData); req.onreadystatechange = function () { if (req.readyState === 4) { if (req.status...

UpdatePanel AsyncPostbackTrigger not firing

asp.net,ajax,webforms,updatepanel
I've got a little problem, any help is appreciated. Situation looks like this: <asp:UpdatePanel ID="UP_Panel" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:DropDownList ID="ddlSwitch" runat="server" Width="250px" AutoPostback="true" OnSelectedIndexChanged="ddlSwitch_SelectedIndexChanged"> <asp:ListItem Value="continent" Text="Continent"></asp:ListItem> <asp:ListItem Value="region" Text="Region"></asp:ListItem> <asp:ListItem Value="country"...

laravel file uploading using json

jquery,ajax,json,laravel,laravel-5
I am using laravel 5. I have did the following code to post data using json to my controller. But I cannot make file uploading by this manner. e.preventDefault(); $.ajax({ type: 'POST', cache: false, dataType: 'JSON', url: 'tasks', data: $('#my_form').serialize(), success: function(data) { console.log(data); }, }); I have the following...

get XML tags from URL using javascript

javascript,ajax,xml
i'm trying to get some tags from the next xml file which is located here: http://open.api.ebay.com/shopping?version=581&appid=EBAYU91VTR1SQ8H917BC11O3BW8U4J&action=getResults&callname=FindItemsAdvanced&QueryKeywords=Aston+Martin+V12+Vanquish&categoryId=220 what do i need to do in order to get the "110" from the tags below: <TotalItems>110</TotalItems> using javascript?...

how to use .load(function() { on a large function

javascript,jquery,ajax,css3
I have 5 pretty large CSS3 / jQuery chain animations within a web page, these occur at 5 subpages, when the user navigates to each individual (5) subpages.. I would like to use / have the effect of jQuery's $( img ).load(function() { // Run code }); Except I only...

cross domain ajax form post — How is this allowed?

jquery,ajax
I am using jQuery and jQuery form plugin There is a method in jQuery form plugin ajaxSubmit. You pass a form and then it submits it via ajax and you get a response. I am wondering how this is possible since the form is on a different server than the...

AJAX in Internet Explorer 11 - Don't cache

javascript,ajax,internet-explorer
I have an issue with AJAX in the IE 11. My page is asking sone values via AJAX form the server using this code: var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new...

How can I properly test PHP scripts that have been POSTed to using AJAX?

php,ajax
I'm struggling to work out how to test my code. I have a script in PHP which takes values from a string and puts them together into a message to be mailed. The form is submitted using AJAX as follows: $.ajax({ type: "POST", url: "actions/sendForm.php", data: dataString, success: console.log('Success!') });...

How to use ajax response JSON data?

javascript,jquery,ajax,json
I have made my ajax request, which works great and returns JSON. But how do i use it? My response is something like this [{ "id": "5", "reviewID": "2389", "serviceID": "50707", "title": "well done" }] Now in my success function I am trying to use the data like such: success:...

Updating View in Angular js on ajax success callback

ajax,angularjs
I am working on a project where I am getting list of the offers from a service. Each offer is Active or Inactive. I am displying only Active offers on a view on tabular format by giving ajax call and using ng-repeat. When I click on the link Inactivate Offer...

WooCommerce seems to only orderby date and not price

php,ajax,wordpress,woocommerce
I am loading in variable products via a custom WP_Query $args = array( 'post_type' => 'product', 'posts_per_page' => 100, 'product_cat' => 'beast-balls', 'orderby' => 'date', 'order' => 'desc' ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class="product-node cat-beast-balls">...

.NET web service gets null object

c#,.net,ajax,web-services,rest
I'm trying to save an object using ajax call and .NET REST web service but I get null object on .NET side. Please help me to find out what's the issue. C# Object: [DataContract] public class Customer { [DataMember] public int Id { get; set; } [DataMember] public string Name...

Array json between ajax and php

javascript,php,jquery,ajax,json
I'm developing a simple guestbook and I want to update the table with all messages without refreshing the page because if someone it's writing a comment and the page refreshes the comment will be lost. So I began writing some code with ajax to update the table but I don't...

ajax post truncating leading zero's

javascript,jquery,ajax
I have the following code: $.ajax({ type: "Post", url: 'http://example.com/jambo', contentType: "application/json", data: String(' ' + $('InputTextBox').val()), success: function (data) { alert("success"); }, error: function (msg) { var errmsg = JSON.stringify(msg); alert("message: " + errmsg); } }); The value in InputTextBox has leading 0's but when this is posted to...

create jquery array for ajax post

javascript,jquery,ajax,datepicker
How can I convert the output of drp.getDateRange to an array so that I can post it via AJAX? I have updated this code to represent the advice given below <script> var drp; var myArray = []; function makedatepicker() { drp = $("#myDate").datepicker({}); } function getRange() { var data =...

How to increment number of fields in php using javascript or jquery or ajax without reload whole page

javascript,php,jquery,ajax,yii
I have a form in yii and there is a text field named certificate_name in it. Now i want that when I click on the plus icon, the text field should increment by one and appear below the previous field. Here is my php code: <?php for ($i = 0;...

Automatically calling server side class without

javascript,html,ajax
I have an anchor which calls a server side class when clicked, but I want to modify it so that the class is called as soon as the page loads, without having to click an anchor. <a href="#" class="_repLikeMore" data-id="1234" data-type="pid" data-app="forums"> ...

How to load two PHP scripts simultaneously using jQuery?

php,jquery,ajax
I have an upload feature that is made up of various different stages, and the duration of this upload can be quite lengthy. To increase usability of this feature, I want to present the user with information concerning the progress of the upload. The upload is processed through jQuery, and...

Table goes max height when screen is resized

javascript,html,css,ajax,table
I have a table that is generated with a min-height of 300px and a max-heigh of 650px which is perfect. The only problem is when i resize the window the table will stretch all the way down until all its values are shown. Its supposed to have a scroll bar...

jQuery tab moves to last tab on button click

jquery,ajax,tabs
I am making an eCommerce web application in Laravel and I am stuck at a point to add products in the admin panel. There are 3 tabs for adding the products General Information Meta Information Product Options. I am using AJAX with for inserting the data in the database. My...

Building an Ajax System for loading New Page Content via link classes

javascript,jquery,ajax,load
The idea is each page has the same header and footer exactly, but each page has inner content that will change each page load <header>blah blah blah</header> <div id="main-content">Changes Each Page, but with links like <a href="anotherpage.html" class="ajaxify">Go to Another Page with smooth animation</a></div> <footer>blah blah blah</footer> I have written...

Using ajax to display what is being typed not working, PHP, AJAX, JAVASCRIPT

javascript,php,jquery,ajax
Using ajax, I'm trying to display what is being typed in the text box, but it's not displaying anything at all for some reason. I know the ajax function itself got called, by using alert inside the function, and I think the real problem is actually in test2.php, but I'm...

how to use geocoder class to retrieve latitude and longitude through ajax

javascript,ajax,google-maps
the json array which contains the list of addresses [ { "id": 0, "title": "Coop.Sociale Prassi e Ricerca Onlus", "latitude": 0, "longitude": 0, "address": "Viale Eleonora D'Arborea 12, Roma, IT" }, { "id": 0, "title": "San Lorenzo", "latitude": 0, "longitude": 0, "address": "Viale della Primavera 330, Roma, IT" },...

asp.net get user information from xmlhttp requests

asp.net,ajax,forms-authentication
I am working on an application where certain actions are performed using ajax requests to a backend api page, such as adding likes to content. The javascript function will pass the user ID and content ID to the api page in an xmlhttp request. We use Forms Authentication with Active...

How to transform $.post to $.ajax?

javascript,jquery,ajax,json,servlets
I have this $.post peace of code: $.post("../admin-login", { dataName:JSON.stringify({ username:uname, password:pass, }) }, function(data,status){ console.log("Data:"+data); answer = data; } ); and I wont to transform it to $.ajax. On the servlet side I am demanding request.getParamter("dataName") but I do not know how to write data: section in $.ajax so...

Ajax GET request confusion

javascript,python,ajax,flask
I am extremely new to javascript/ajax/flask and am trying to get data from my flask server. I am rendering the client.html template and need to get data from the /data route. app = Flask(__name__) @app.route("/data", methods=["GET"]) def submit_handler(): return 10 #example value @app.route('/client') def page(): return render_template('client.html') if __name__ ==...

How to simulate $.ajax array POST request with Java

java,javascript,php,ajax
I'm trying to simulate ajax post request with java program. The simulation works but if I post an array, it comes back as a string. I'm using Guava: Map<String, String> data = new HashMap<String, String>(); data.put(URLEncoder.encode("affected_ids[]", "UTF-8"), URLEncoder.encode(Joiner.on(":").join(arrIds), "UTF-8")); data.put("select_all", "true"); String d = Joiner.on("&").withKeyValueSeparator("=").join(data); The content of d looks...

my done button somehow went to a blank page and delete won't work unless I refresh -ajax

javascript,php,jquery,ajax,button
I am playing around with a todo list I learned online. Trying to add ajax into it. Works well when I try to add an item. When an item is added there's a button says 'Mark as done' so I can click on it and then there will be a...

What factors should take into consideration when choosing between basic AJAX (like HTTP polling) and reverse AJAX (like Long Polling)? [closed]

java,javascript,ajax,reverse-ajax
I know real-time chatting app definitely needs reverse AJAX.But how about other applications that real-time function is not so important? Say there is a notification function like on Stackoverflow. When people answer your question you get a notification. Probably this is not so important for user to get notified immediately...

static void c# webmethod can't reference user control?

c#,ajax,webmethod
I have a WebMethod where I just want to flip a property to true. I am putting it in the code-behind of a .aspx page using C#. public partial class Data : Base { protected void Page_Load(object sender, EventArgs e) { this.bgc1.BGEnabled = false; } [WebMethod(EnableSession = true)] public static...

AJAX request doesnt change text in div

javascript,jquery,ajax
I'm currently performing a task which involves getting the information from a file using php and returning it using AJAX. The data is getting sent as I tested this using an alert, however for some reason the line: param.html(str); won't change the text in the div... Here is my function:...

Check AJAX response data before taking action

javascript,php,jquery,ajax
I have an AJAX call to a PHP script that returns either the content of a Bootstrap3 modal, or an HTML form. PHP code - (ajax.php): if ($numLegs == 1) { echo $formData; } else { echo $modalContent; } If it returns $formData, I want to display the form data,...

angular $http get all headers

ajax,angularjs
TL;DR; I want to get all headers from the $http service and display them to the page. I don't care if it is only a list of the keys or the key/value pairs. How can I do this? Why has what I have been doing not working? What I want...

How to create sub string in a line read from text file separated by comma

javascript,ajax,regex,file-handling
I am java script newbie and i have a text file like this Address.txt : Andhra Pradesh,East Godavari,Reach within 36 Hrs Andhra Pradesh,Guntur,Reach within 36 Hrs Andhra Pradesh,Krishna,Reach within 36 Hrs Andhra Pradesh,Visakhapatnam,Reach within 36 Hrs Andhra Pradesh,Chittoor,Reach within 36 Hrs Now i want to separate each loine by substring...

Using ajax to display what is being selected not working, PHP, AJAX, JAVASCRIPT

javascript,php,jquery,ajax
Using ajax, I'm trying to display what is being selected, but it's not displaying anything at all for some reason. I know the ajax function itself got called, by using alert inside the function, and I think the real problem is actually in test2.php, but I'm not sure what I...

Hide 'show more' button using AJAX

javascript,php,jquery,ajax,wordpress
I have button "Show more" on my WP site. By default 2 posts are shown, and on click on this button appears other 2 posts. So I need to check on page load, if there is more than 2 posts. It there is not, button hides. I use AJAX for...

Javascript asynchronous calls to a function that updates DOM elements are overlapping and causing issues

javascript,jquery,html,ajax,forms
The context: I have a form that asks for a zipcode, state, and city. Next to each input field I have two spans, one that shows a green checkmark if the input is good, and one that shows a red x if the input is bad. Naturally only one is...

Check with jquery if result/echo from PHP starts with “abc”

php,jquery,ajax
I am using jquery and ajax to submit forms without page reloading and then depending on the result (whether it is a success or an error) I print the message in two different divs. Since success and error in ajax only checks the client/server connection I echo some stuff from...

json_decode returns NULL, json_last_error throws 0

php,ajax,json
I'm passing a simple JSON array with 4 words to PHP. I want to store that array in a database after I serialize it. Since it's an Ajax call I can only investigate any echoed values by json_encode and alerting them in AJAX success function. Here's my code: var jsonString...

Disable 2 buttons after click of a button

javascript,php,jquery,html,ajax
I have a submit button on page index.php When i click this button another script (call.php) is called through ajax that holds some response. Now i want that time between the click of submit button and response displayed/received under a div through the call of ajax script the buttons option1...

Event on blur and on submit?

javascript,jquery,ajax
How can I change the following to submit on both blur and on submit: $('form').on('blur', 'input', function(event) { }); ...

When is the cookie set by AJAX available in javascript?

javascript,ajax,cookies
I'm doing an AJAX call and setting a cookie in the user browser in the response (the server code sets the cookie). I noticed in the success callback from the ajax, the cookie is not available. When I look in document.cookie the new cookie is not there. My question, when...

how to put datepicker in controller in yii

php,jquery,ajax,yii,datepicker
I have a form in yii and one field in form is come from controller by clicking on a button. if i pass text field instead of datepicker then it works otherwise it gives error so what to do now? my form code is as below: <div class="row buttonproduct" hidden>...

Sending LIst via ajax to complex model

javascript,c#,asp.net,ajax
I know I've done this before but I can't seem to get this to work. I have the following JavaScript; $("#btnTestVouchers").click(function () { var postData = { "workplaceGiverId": $(".wpgDropdownList").val(), "fromMemberId": $(".wpgFromMemberDropdownList").val(), "toMemberId": $(".wpgToMemberDropdownList").val(), "voucherExpiryDate": $("#expiryDatePicker").val(), "recipients": JSON.stringify("[{'firstname':'a','lastname':'b','email':'c','voucheramount':'d'}]") }; console.log(postData); $.ajax({ type: "POST", url:...

Modal won't close on ajax success

jquery,ajax
I'm loading in the content of a modal with ajax. I have a button that submits the modal form and is suppose to close the modal when it's done processing the ajax submit so it can update a table at the bottom of the page. It's not closing the modal...

Unable to upload file to Sharepoint @ Office 365 via REST

javascript,ajax,rest,sharepoint,office365
I'm having trouble creating/uploading files via Microsoft's REST API (or at least that's what they call it) for Sharepoint running on Office 365. It looks like I'm able to authenticate all right, but I'm getting 403 Forbidden when I try to create a file. The same user can upload a...

ajax test not working

javascript,php,jquery,ajax
I tried to get a simple ajax-test working but without success. I am trying to pass a variable($add1) from PHP to JS, then let the JS calculate the sum and return it back to a PHP variable via $_POST and ECHO it out in the html. index.php: <?php echo "<script...

jquery - add header request to specific ajax request

javascript,jquery,ajax
I need to add some header details to one specific ajax request that one of the third party control will make. The third party control allows me to set the URL but it does not allow me to add header information to the request. So far I am able to...

access the json encoded object returned by php in jquery

php,jquery,ajax,json
I want to post some data to php function by ajax, then get the encoded json object that the php function will return, then I want to get the information (keys and values) from this object, but I don't know how, here is my code: $.ajax({ url: "functions.php", dataType: "JSON",...

How to access elements rendered into the page with Mustache using jQuery

javascript,jquery,ajax,mustache
I am rendering some content into my page using a mustache template and ajax. I would then like to interact with some of the elements (hide them depending on page position) using another function (componentLoaded). Obviously this function needs to run after the items are rendered on the page, but...

Jquery html page dynamic control and load

jquery,html,ajax
I am cremating HTML table with some complex logic so i have create html page for row like GridRow.html and one main page which contents table tag i load GridRow.html page using ajax request and get result as string html,in that page we have some select option list i need...

post serialized data through using jquery load method in codeigniter

javascript,php,jquery,ajax,codeigniter
Here is my code. <form id='user'> <label for="name">Name :</label> <input type="text" id="name" name="name"/> <label for="email">Email :</label> <input type="text" id="email" name="email"/> <input type="submit"/> </form> <div id="output"></div> jQuery: $('#user').on('submit',function(event){ event.preventDefault(); var data=$(this).serialize(); adddetails(data); }); function adddetails(data){ var url='http://localhost/projectname/index.php/users/adddat';...

.NET wep api won't accept %2E or . in api request uri

c#,jquery,asp.net,ajax,json
We're trying to create our first web api using the .net framework. To try this we've used this demo project: http://www.codeproject.com/Articles/549152/Introduction-to-ASP-NET-Web-API In this project we've changed the find() function of the AJAX script so it only sends one var to our new democontroller.: <script> var uri = 'api/Demo'; function find()...

Using $.ajaxStop() to determine when page is finished loading in CasperJS

javascript,jquery,ajax,phantomjs,casperjs
So far in my tests written in CasperJS, I've been using waitForSelector() on page-specific elements to determine if a page has fully loaded (including all the async ajax requests). I was hoping to come up with a more standard way of waiting for page load and was wondering if the...

Why are fields reset after ajax update with Primefaces

ajax,jsf-2,primefaces
On a form I have some personal information (name, address etc.) and a changeListener which updates the salutation and letter salutation according to the gender and last name. If the underlying entity was already stored in the database it works fine. If I'm entering data for a new (not saved)...

Ajax function not working when passing one of the variables through parameter, PHP, JAVASCRIPT, AJAX

javascript,php,jquery,ajax
I'm trying to write a function to get the value from a select statement, and echo the value to the screen. It works when I put the exact select name inside of the ajax function, but it stopped working when I tried to pass the select name through the parameters....

How to calculate values of a drop down menu with PHP/ JS?

javascript,php,ajax
Hi I have been very puzzled how to do this and cannot find any relevant tutorial that could help me so I thought I would ask here and hope to find the help. I have a form with 2 drop down menus, each of them having a value attribute. What...

How use jquery getJSON with a local variable

javascript,jquery,ajax,json,ace-editor
i want to extend the completions of Ace Editor, and i need a json of word, this is my code: function load_completions() { var object = $('#preview').attr('class'); $.ajax({ type: "POST", url: "test_editor_ajax.php", data: {action:'load_completion', object:object}, cache: false, success: function(json){ var adminCompleter = { getCompletions: function(editor, session, pos, prefix, callback) {...

Run AJAX function on form submit button after javascript confirm() cancel

javascript,jquery,ajax,wordpress,forms
I have a form where and AJAX function runs on form submission to make sure that the data in the form doesn't conflict with data in the database. If a conflict is found, the AJAX function pops up a confirm() box. If the user clicks "OK", the form is submitted....

Loading external php file in a div with jquery ajax

javascript,php,jquery,ajax,mysqli
i am making a simple project..and i need to load data from other page in an index.php..and i have set time of 20sec. but its not working.. could u please tell me what is wrong with the query..Thanks already.. index.php <?php include 'connection.php'; ?> <html> <head> <title> My First Chat...

Odd Contradictory Error

javascript,ajax
I have a heroku website with ruby, but my issue is with one page in perticualr. The issue with that page is javascript. The page also has ajax on it. Here is my page: <!DOCTYPE html> <html> <head> <script> var refreshDelay = 5000000; function createRequestObject() { var ro; if(navigator.appName ==...

Jquery parsley validate not working

javascript,php,jquery,ajax,parsley.js
if($("#dataform").parsley().isValid()){ $.ajax({ url : '<?php echo base_url();?>index.php/company/final_review?id=<?php echo $this->input->get('id'); ?>', type : 'POST', data : $("#dataform").serialize(), dataType:"json", beforeSend: function(){ $('#remarks').parsley( 'addConstraint', { minlength: 5 }); }, success : function(data){ console.log(data); } }); } This is my ajax part. The plugin is not validating the field it's submitting the form. The...

Why PartialView cannot reload with Ajax in MVC

ajax,asp.net-mvc,asp.net-ajax,asp.net-mvc-partialview,ajax.beginform
I use a popup window to create a new record and I render a view inside the window. In addition to this, I call a partialview in this view according to the selectedindex of a combobox in it. I can successfully post the form to the Controller and return it...

How to send current page number in Ajax request

javascript,jquery,ajax,spring-mvc,datatables
I am using jQuery DataTable to display huge amount of data in a table. I am getting data page wise on Ajax request like this: var pageNo = 1; $('#propertyTable').dataTable( { "processing": true, "serverSide": true, "ajax": "${contextPath}/admin/getNextPageData/"+pageNo+"/"+10, "columns": [ { "data": "propertyId" }, { "data": "propertyname" }, { "data": "propertyType"...

Parameters from f:param not submitted with AJAX request when form enctype is multipart/form-data

ajax,jsf,jsf-2,jsf-2.2,wildfly
I'm running Wildfly 8.2 and I'm using the JSF version bundled with it, 2.2.8-jbossorg-1. I have the following facelet: <h:form enctype="multipart/form-data"> <h:commandButton value="Submit"> <f:param name="myparam" value="true"/> <f:ajax execute="@this" render="@this"/> </h:commandButton> </h:form> When I press the submit button, several parameters are submitted, but not myparam. If I remove enctype="multipart/form-data" from the...

stop the video while close popup window

javascript,html,ajax
while i click on open video button one popup window will display . but after closing that popup window video sound playing contentiously i want to stop that video at the time of closing popup window . pop_video.html <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,...

json_encode and parsing information if there are no records returned

php,ajax,json
I make some AJAX (PHP + JQuery), but I have one problem. I have: dataType:"json", in Javascript Everything works fine when json_encode returning some records from DB. The problem is what to do, how to say server in case that there are not any records? When I have an array...

jQuery or AngularJS Ajax “POST” request to server using code below however do not sending param data to server.

javascript,jquery,ajax,angularjs,iis
"POST" request to server using code below however do not sending param data to server. I tried jQuery Way and var request = $.ajax({ url: baseUrl, type:'post', data: 'userId=userabcd&passwd=abcd1234', }); request.done(function( msg ) { console.log(msg); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); AngularJS...

Symfony2: ajax call redirection if session timedout

ajax,symfony2,session
I have a working dashboard with ajax request. I fire an ajax request on some events which will update a part of the dashboard. But if the session has expired, the part will be refreshed with the login page. How can i do a redirection after the ajax call if...

How to send data from one form on a page with multiple forms through AJAX?

php,jquery,ajax
index.php: <script> $(document).ready(function(){ $("form").submit(function(){ var str = $(this).serialize(); $.ajax({ type: "POST", url:"do.php", data: $("form").serialize(), }); return false; }); }); </script> <form action='do.php' method='post' id='toDo' name='toDo'> <input type='hidden' name='okok' value='one.txt'> <button type='submit' class='theButton'></button> </form> <form action='do.php' method='post' id='toDo' name='toDo'> <input type='hidden' name='okok' value='two.txt'>...

Server side vs client side website

javascript,html,ajax,html5,seo
We have to build a website and we have to chose where to manage the content, in the server (PHP or JSP) or on the client (JavaScript). This article: http://searchenginewatch.com/sew/how-to/2358775/seo-strategies-for-javascript-heavy-single-page-applications-or-ajax-sites enlighted me a bit but Im still doubting. Good SEO is the most important thing to achieve. Can anyone relate...

file input type not being included in jquery FormData for AJAX send

javascript,php,jquery,ajax
I have a simple form that will be sent via AJAX to a php file for processing, this form includes a file upload, for some reason the file upload is not being included in the data to be sent. My html form: <form id="business-form"> <label for="business-name">Business Name:</label> <input type="text" id="business-name"...

Very weird behavior when using “var” keyword in an ajax request

javascript,ajax,variables,var
I've been worrying about this for a while and I can't realize what's really happening. Explanation in code comments. There are 2 versions of an application, one of them throws weird results and the second one does the expected work. var id = "test1"; $.post("http://fiddle.jshell.net/echo/json/", {"data": "data"}, function(a) { alert(id);...

Getting a collection via Ajax to show in view

jquery,ruby-on-rails,ajax
All I'm trying to do is have a collection populate in the view when a user clicks a button. But I feel like I'm making this way too complicated and it's not working. See my code - where am I going wrong? Click handler: $('#filterrific_results').find('.followup-injury').on('click', function(e){ e.preventDefault(); $.ajax({ url: "/assessments/followups",...

How to trigger ajax loading with an observable varariable in knockout?

ajax,knockout.js
I got some tabs in a page. When clicking on a tab, the currentTab changes its value, which should trigger an ajax loading of a new tab content. The concept is similar to a ko.computed, which however, only update another variable as the value change takes place. Is there any...

Get all images from local folder

javascript,jquery,ajax
I need a way to get all the images from a local folder for a presentation that will also run locally. There will be no attempt for a server to take the images from a local folder since that is not possible/the case. I need to use .js since I...

Yii reload page after CGridview Delete

php,ajax,yii
OK, this is frustrating. All I simply want to do is reload the page after a CGridView Delete action. As the Delete is performed VIA Ajax, I cannot seem to reload the page. I need to do this as I have other data on the page that is dependant on...

Strange situation, Visual Studio debugging ran through action to view but nothing returned to browser

c#,jquery,ajax,asp.net-mvc,razor
I have encountered a very strange problem. Basically, there is a Delete ActionLink. Once clicked, the code checks the condition, checks true/false, stays on current page or goes to Delete view. I have posted the solution for this scenario and got some very helpful replies. I worked on it and...

Making an alert() with PHP and ajax

javascript,php,jquery,ajax
I have an ajax function that submits some data to my PHP file. In my PHP file I have some checks that it does with that data, I then try to make an alert to come up to say something. I can't get any alerts to come up though. All...

Getting a JavaScript object into my controller: What am I missing here?

c#,asp.net,ajax,json,asp.net-mvc
I'm getting a 500 (Internal Server Error) when I try to run $.ajax({ xhr: function() { var xhr = new window.XMLHttpRequest(); return xhr; }, type: 'POST', url: [email protected]("MyAction","MyController")', data: fi, contentType: "application/json; charset=utf-8", dataType: "json", // dataType is json format success: function(retJson) { // ... } }); where fi is...