apicton Posted August 24, 2013 Share Posted August 24, 2013 Hi all- this is my first post here, I've been working with javascript for only a few months and can usually find the answers by googling, but I am kind of stumped on this one. I have a form where I can select toppings for a pizza and when you change the dropdown selector to choose a topping, a javascript function posts to a standalone php file to automatically update the database. It works great in chrome, but I can't seem to get it to work in IE. If I run the standalone script directly in a browser window, it works, even in IE. So I am assuming that my javascript code that posts to the file is not able to post to the file in IE for some reason. Here is the js function trying to post to the form: function updateCart() { var filename = "<?php echo $server;?>update_cart.php"; $.post(filename, $("#cartform").serialize()); alert("file name: " +filename); } The alert pops up and correctly displays the path to the file in both chrome and IE. Does anyone see any obvious reasons why this wouldn't work in IE? thanks for your help, Andy Link to comment https://forums.phpfreaks.com/topic/281524-using-javascript-to-post-to-php-file-to-update-database-ie-issue/ Share on other sites More sharing options...
apicton Posted August 24, 2013 Author Share Posted August 24, 2013 ok, I figured it out. Thanks anyhow... I guess I didn't need to add the whole server part of the file when posting to it, and for some reason IE didn't like it. So i changed my function to the following and it worked: function updateCart() { var filename = "update_cart.php"; $.post(filename, $("#cartform").serialize()); alert("file name: " +filename); } Link to comment https://forums.phpfreaks.com/topic/281524-using-javascript-to-post-to-php-file-to-update-database-ie-issue/#findComment-1446581 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.