Unlimited POST requests on Safari 7


I'm facing a challenging issue that has me stuck. I have a form where users submit their data, triggering a post ajax request. Upon success, I populate some data in a hidden form with an action pointing to the current subdomain URL, but actually redirecting to a partner site URL set over CNAME. Then, I programmatically submit the hidden form using jQuery, so that after the response, the user ends up on the partner site (since the hidden form has no target attribute). This setup works smoothly on all browsers except for Safari 7 on Mac – it simply keeps loading indefinitely.
Any assistance on this matter would be greatly appreciated.

There isn't much code involved. After running the following code upon success:

if (response.result === true) {
    this.targets.login.$email.val(response.data.data.email);
    this.targets.login.$password.val(response.data.data.password);
    this.targets.login.$form.submit();
}

The structure of my hidden form is as follows:

<form action="http://someurlunderCNAME" method="POST">
    <input type="hidden" name="_method" value="POST">
    <input type="text" name="data[User][email]">
    <input type="password" name="data[User][password]">
</form>

Answer №1

After investigating further, I discovered the issue was caused by triggering submit on form. The proper behavior is actually to trigger a click on the submit input (which should also be included).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best method for transferring $scope to a controller using ng-click?

The template I am working with looks like this: <div class="book-thumbs"> <div class="book-pic" ng-repeat="img in book.images"> <img ng-src="{{img}}" ng-click="vm.setImage(img)"> </div> </div> When trying to invo ...

Struggling with identifying errors in the Javascript code for my assignment

My code is giving me trouble and I could really use some assistance You can find my code in this GitHub folder: link. To see the project in action, visit this page on GitHub Pages: link. The task involves iterating over an array of names and printing eit ...

Why does my loading screen appear again when I submit the form and refresh the page?

I've been working on setting up a login page and was able to create a loading screen that fades away once the page has finished loading. $(window).on("load",function(){ setTimeout(function() { $(".lo ...

The jQuery script is functioning flawlessly in one specific direction

Currently, I am utilizing a basic script to alter the color of elements based on the div being hovered over. While this works smoothly in one direction down the line, when trying to reverse order and backtrack, the colors do not function as intended. The ...

How to retrieve data from MySQL using PHP by searching multiple rows separated by commas

I am looking for a tracking system similar to DHL, where I can track shipment numbers from my MySQL database using a PHP form. However, I need the ability to search for multiple rows separate by a comma in PHP and MySQL. https://i.sstatic.net/cTXiU.jpg &l ...

Close ui-bootstrap typeahead menu only when a row is manually chosen

I have set up this jsBin to show the problem I am facing. When you visit the link and try to type "Five," the expected behavior would be to type "Five" and then press tab. However, in this case, you need to type "Five" and then either escape or click outsi ...

Unable to receive a response in React-Native after sending a post request

My current challenge involves sending a response back after successfully making a post request in react-native. Unfortunately, the response is not arriving as expected. router.route("/addUser").post((req, res) => { let name= req.body.name; connection ...

Troubleshooting: Issues with TextureLoader causing image rendering failure in three.js

Here is the approach I take to incorporate an image using three.js - rendererModule.addImage = function (primitive){ var self = this; var textureLoader = new THREE.TextureLoader(); console.log("This is step 1"); textureLoader.load("image/m ...

When you utilize .text() to extract the text from a DIV, it will indeed provide the expected result

I am developing a tool that allows users to choose a space type, such as office, warehouse, or storage, and then calculate the kWh usage, kWh cost, fuel usage, and fuel cost per square foot. The fuel type used is natural gas, and all other types fall under ...

grabbing data from different domains using jQuery

I attempted to implement cross-domain AJAX examples, but unfortunately, it did not function as expected. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/ht ...

AngularJS requires that JSON object property values be converted to strings in order to be displayed as actual templates

Each tab click accesses a json array containing unique templates such as ui-grid or c3 chart directive (c3.js). When a specific tab is clicked, the template in string format must be rendered into actual templates like ui-grid, c3-chart, etc. var sampleJs ...

jQuery Ajax error 403 (unlike XMLHttpRequest)

Recently, I encountered an issue with two Ajax calls in my code. One of the calls was implemented using XMLHttpRequest and the other one using jQuery. Surprisingly, the first call completed successfully without any errors. However, the second call, which s ...

The field is open to all possibilities! Is there a way to limit the specific data types the field can accept

I am experiencing an issue with my student ID field as it is accepting all types of data, including strings. I want it to only accept integers. How can I fix this bug and restrict the data type to integers for the student ID field? I am unsure of any API o ...

I am having trouble understanding the error message in my three.js code

Recently, I have been working with three.js and wrote the following code. However, I encountered an error. Can anyone help me identify the part that needs to be changed to make the code error-free? import * as THREE from "/assets/threejs/build/three ...

Determining the presence of an HTML element in the correct manner

Is there a correct method for verifying the existence of an HTML element on a webpage? This is how I usually approach it: if (document.getElementById('container') !== null) {doThis()} What are your thoughts on this approach? Are there alte ...

Fill a JavaScript array with URLs that have a designated class

I need to extract links from a website source code and store them in an array, selecting only those with a specific a class. For example, let's say the links have the class <a class="title">, how can I identify each class and save its URL to an ...

Enhance your AngularJS application with advanced security features and implement a local storage

I have implemented an AngularJS application that utilizes angular ui-router for routing. Despite my efforts to enhance security, I encountered some challenges: To manage user authentication, I store tokens and user roles in local storage, redirecting ...

Unexpected provider error in AngularJS when using basic module dependencies

I am encountering an issue with my module setup involving core, util, and test. The util module has no dependencies and one provider The test module depends on util and core, and has one controller The core module depends on util, and has a provider that ...

Error: Access to cross-origin frame blocked for iframe located at "http://localhost:8080" when attempting to access other iframes on the page

I am currently attempting to extract and list the names of all the iframes present on a webpage for Selenium automation. The challenge lies in the fact that each iframe's name changes dynamically, necessitating a method to iterate through all of them ...

Retrieve identification details from a button within an ion-item located in an ion-list

<ion-list> <ion-item-group *ngFor="let group of groupedContacts"> <ion-item-divider color="light">{{group.letter}}</ion-item-divider> <ion-item *ngFor="let contact of group.contacts" class="contactlist" style="cl ...