Help with having multiple jave and ajax calls on the same page
- or -
Post a project like this4032
£15(approx. $19)
- Posted:
- Proposals: 2
- Remote
- #234066
- Awarded
Description
Experience Level: Entry
Hi, Everyone. I need some help with multiple java script and ajax calls on the same page -
I have the following script that works as it should do.
function swapContent(cv) {
$("#inPlayCards").html('').show();
var url = "inplaycards-shoot.php";
$.post(url, {contentVar: cv} ,function(data) {
$("#inPlayCards").html(data).show();
});
}
The button used to call the script is -
Click
The php page is
$contentVar = $_POST['contentVar'];
if ($contentVar == "inplaycards") {
mysql query, etc etc
}
The problem I am having is when I add a second script/button to the same page.
Like this
function shootone(cv) {
$("#one").html('').show();
var url = "inplaycards-shoot1.php";
$.post(url, {contentVar: cv} ,function(data) {
$("#one").html(data).show();
});
}
I am looking to have a minimum of three additional buttons on my page...
I am guessing this will be a ten minute job for someone who knows what they are doing.
I have the following script that works as it should do.
function swapContent(cv) {
$("#inPlayCards").html('').show();
var url = "inplaycards-shoot.php";
$.post(url, {contentVar: cv} ,function(data) {
$("#inPlayCards").html(data).show();
});
}
The button used to call the script is -
Click
The php page is
$contentVar = $_POST['contentVar'];
if ($contentVar == "inplaycards") {
mysql query, etc etc
}
The problem I am having is when I add a second script/button to the same page.
Like this
function shootone(cv) {
$("#one").html('').show();
var url = "inplaycards-shoot1.php";
$.post(url, {contentVar: cv} ,function(data) {
$("#one").html(data).show();
});
}
I am looking to have a minimum of three additional buttons on my page...
I am guessing this will be a ten minute job for someone who knows what they are doing.
3TTechnology T.
98% (10)Projects Completed
14
Freelancers worked with
10
Projects awarded
30%
Last project
29 May 2014
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies