Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

ITE 254: Web Programming 2 Fall 2018 Exam #3 For this exam, you will create the necessary jQuery/Ajax code to complete the program described below. You may not ask for help on this exam nor may you...

1 answer below »
ITE    254:    Web    Programming    2     Fall    2018    

Exam    #3    
For    this    exam,    you    will    create    the    necessary    jQuery/Ajax    code    to    complete    the    
program    described    below.    You    may    not    ask    for    help    on    this    exam    nor    may    you    
consult    any    other    human    being    in    any    way.        
    
Get    Started    â€¦    
    
I    have    created    2    files    for    you    to    use    within    my    i:/    drive    directory.    
The    files    are…    
calctotal_ajax.php    
calctotal    _jquery.html    
    
Laptop    users    can    get    the    files    here…    
http:
newton.ncc.edu/gansonj/ite254/calctotal_jquery.txt    
http:
newton.ncc.edu/gansonj/ite254/calctotal_ajax.txt    
    
A    video    of    a    sample    run    of    the    program    can    be    found    at…    
http:
newton.ncc.edu/gansonj/ite254/vids/calctotal_video.mp4    
    
        
You    will    only    need    to    write    the    necessary    jQuery    /    Ajax    within    the    
'calctotal_jquery.html'    file    to    get    this    program    to    work.    
    
The    user    will    enter    a    cost    and    a    quantity,    you    must    write    the    jQuery    and    Ajax    
needed    to    call    the    calctotal_ajax.php    page.    The    Ajax    code    page    will    calculate    the    
total    and    return    the    output.    Your    jQuery    will    display    the    output.    
    
If    the    user    enters    a    value    of    100    for    the    quantity,    print    the    output    in    purple,    for    
any    other    quantity    value,    print    the    output    in    the    default    green.    
    
Pay    attention    to    your    datatypes!    
    
You    will    only    upload    your    revised    version    of    the    calctotal_jquery.html    page.    
Nothing    else.    It    must    work    with    my    supplied    Ajax    file.    
    
You    may    not    alter    my    supplied    PHP/HTML/CSS    code    in    any    way.
Answered Same Day May 13, 2021

Solution

Swapnil answered on May 13 2021
136 Votes
84016/calctotal_ajax.php
?php
header('Access-Control-Allow-Origin: *');
$form_data = a
ay();
Pass back the data to `form.php`
if( isset( $_POST['cost'] ) && isset( $_POST['quantity'] ) ) {
    
$_POST['cost'] * $_POST['quantity'];
    $form_data['result'] = $_POST['cost'] * $_POST['quantity'];
    echo json_encode($form_data);
}
ends isset IF check
?
__MACOSX/84016/._calctotal_ajax.php
84016/calctotal_jquery.html
    
    
        
            Calculate Total Cost
            Purchase 100 items and you get purple output
        
        
        
            Cost of item
            
            
            Quantity
            
            
            
            
        
        
        
            
        
        
    
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here