Questions
What did I do wrong? When you click on the small caption of the photo, it...

What did I do wrong? When you click on the small caption of the photo, it is supposed to have a call to AJAX that changes the small description of my fav activities to a bigger description.

For example, when you click "cooking" it should change to what I have in the biginfo file but it does not change.

This is the full code. The "biginfo" files I have are done,  don't have anything but the fuller description.  

HTML

_________________

<!DOCTYPE html>

<html>

<head>
<title>Slideshow</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="text/html; charset=iso-8859-2" http-equiv="Content-Type">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<style>
.mySlides {display:none;}
.onPic{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: black;
font-size: 12px;
}
</style>
</head>

<body>

<h2 class="w3-center">My Favorite Actitivies</h2>

<div class="w3-content w3-section" style="max-width:500px">
<div class="mySlides">
<img src="cooking.jpg" style="width:100%">
<button class="onPic" type="button" onclick="loadDoc1()">Cooking</button>
  
</div>

  
<div class="mySlides">
<img src="lacrosse.jpg" style="width:100%">
<button class="onPic" type="button" onclick="loadDoc2()">Lacrosse</button>
</div>
  
<div class="mySlides">
<img src="jogging.jpg" style="width:100%">
<button class="onPic" type="button" onclick="loadDoc3()">Jogging</button>
</div>
  
<div class="mySlides">
<img src="music.jpg" style="width:100%">
<button class="onPic" type="button" onclick="loadDoc4()">Listening to music</button>
</div>
  
<div class="mySlides">
<img src="dog.jpg" style="width:100%">
<button class="onPic" type="button" onclick="loadDoc3()">Playing with my dog</button>
</div>
  
<div class="mySlides">
<img src="tv.jpg" style="width:100%">
<button class="onPic" type="button" onclick="loadDoc4()">Watching TV</button>
</div>
  

</div>

<script>
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
  
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 7000); // Change image every 2 seconds
}
  
function loadDoc1() {
var xhttp1 = new XMLHttpRequest();
xhttp1.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp1.open("GET", "biginfo1.txt", true);
xhttp1.send();
}

  
function loadDoc2() {
var xhttp2 = new XMLHttpRequest();
xhttp2.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp2.open("GET", "biginfo2.txt", true);
xhttp2.send();
}
  
  
function loadDoc3() {
var xhttp3 = new XMLHttpRequest();
xhttp3.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp3.open("GET", "biginfo3.txt", true);
xhttp3.send();
}

function loadDoc4() {
var xhttp3 = new XMLHttpRequest();
xhttp3.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp3.open("GET", "biginfo4.txt", true);
xhttp3.send();
}
function loadDoc5() {
var xhttp3 = new XMLHttpRequest();
xhttp3.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp3.open("GET", "biginfo5.txt", true);
xhttp3.send();
}
function loadDoc6() {
var xhttp3 = new XMLHttpRequest();
xhttp3.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp3.open("GET", "biginfo6.txt", true);
xhttp3.send();
}

</script>

</body>
</html>

BIGINFO1

--------------------

"I like to cook because it is fun"

In: Computer Science

Summary Figure 3–79 shows an example page containing two applications of floating objects. In the first...

Summary

Figure 3–79 shows an example page containing two applications of floating objects. In the first line of Lincoln’s second inaugural speech a drop capital is created by floating the first letter of the first paragraph next to the surrounding text. The text of the speech is wrapped around the image of Lincoln using an irregular line wrap. This effect is created by cutting the Lincoln image into separate strips which are floated and stacked on top of each other. In this Coding Challenge you will explore how to create both effects.

Figure 3-79

Do the following:

1. Open the files code3-1.html and code3-1_float.css and in the comment section enter your name (First + Last) and the date (MM/DD/YYYY) into the Author: and Date: fields of the file.

2. Go to the code3-1.html file in your editor. Within the head section insert a link element linking the page to the code3-1_float.css style sheet file. Take some time to study the content of the page.

3.lOpen the file code3-1_float.css, and for all img elements create a style rule to set the height of the image to 3.3em. Float all img elements on the right margin, but only when the right margin is first cleared of any floats. (Hint: clear: right).

4. To create a drop cap insert a style rule for the selector p:first-of-type::first-letter and add the following styles:

  1. Float the element on the left margin.
  2. Set the font size to 4em and the line height to 0.8em.
  3. Set the size of the right margin and padding space to 0.1em. Set the bottom padding to 0.2em.

5. Display the first line of the speech in small caps by adding a style rule for the selector p:first-of-type::first-line that changes the font variant to small-caps and the font size to 1.4em.

6. Open the page in the browser preview and verify the layout of the page resembles that shown in Figure 3-79.

Code 3-1.HTML to be edited:

<!doctype html>

<html lang="en">

<head>

   <!--

   New Perspectives on HTML5 and CSS3, 8th Edition

   Tutorial 3

   Coding Challenge 1

   

   Author:

   Date:

   Filename: code3-1.html

   -->

   <meta charset="utf-8">

   <title>Coding Challenge 3-1</title>

   <link href="code3-1.css" rel="stylesheet" />

</head>

<body>

   <h1>Lincoln's Second Inaugural</h1>

   <p>The Almighty has his own purposes. "Woe unto the world because of offenses! For

      <img src="lincoln01.png" alt="" />

      <img src="lincoln02.png" alt="" />

      <img src="lincoln03.png" alt="" />

      <img src="lincoln04.png" alt="" />

      <img src="lincoln05.png" alt="" />

      <img src="lincoln06.png" alt="" />

      <img src="lincoln07.png" alt="" />

      <img src="lincoln08.png" alt="" />

      <img src="lincoln09.png" alt="" />

      <img src="lincoln10.png" alt="" />

      it must needs be that offenses come; but woe to that man by whom the offense

      cometh." If we shall suppose that American slavery is one of those offenses which,

      in the providence of God, must needs come, but which, having continued through his

      appointed time, he now wills to remove, and that he gives to both North and South

      this terrible war, as the woe due to those by whom the offense came, shall we discern

      therein any departure from those divine attributes which the believers in a living

      God always ascribe to him?

   </p>

   <p>Fondly do we hope &mdash; fervently do we pray &mdash; that this

      mighty scourge of war may speedily pass away. Yet, if God wills that it continue

      until all the wealth piled by the bondsman's two hundred and fifty years of unrequited

      toil shall be sunk, and until every drop of blood drawn by the lash shall be paid by

      another drawn with the sword, as was said three thousand years ago, so still it must

      be said, "The judgments of the Lord are true and righteous altogether."

   </p>

   <p>With malice toward none; with charity for all; with firmness in the right, as God

      gives us to see the right, let us strive on to finish the work we are in; to bind up

      the nation's wounds; to care for him who shall have borne the battle, and for his

      widow, and his orphan &mdash; to do all which may achieve and cherish a just and lasting peace

      among ourselves, and with all nations.

   </p>

</body>

</html>

Code 3-1.css to be edited:

@charset "utf-8";

/*

   New Perspectives on HTML5 and CSS3, 8th Edition

   Tutorial 3

   Coding Challenge 1

   Author:

   Date:   

   

   Filename: code3-1.css

*/

body {

   width: 900px;

   margin: 20px auto;

   font-family: Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", "serif";

   font-size: 1.25em;

   padding-bottom: 30px;

}

h1 {

   font-size: 2.2em;

   text-align: center;

}

Code 3-1_float.css to be edited:

@charset "utf-8";

/*

   New Perspectives on HTML5 and CSS3, 8th Edition

   Tutorial 3

   Coding Challenge 1

   Author:

   Date:   

   

   Filename: code3-1_float.css

*/


Images being used:

  • lincoln01.png
  • lincoln02.png
  • lincoln03.png
  • lincoln04.png
  • lincoln05.png
  • lincoln06.png
  • lincoln07.png
  • lincoln08.png
  • lincoln09.png
  • lincoln10.png

In: Computer Science

The purpose of this homework is to test your knowledge of GUI. Consider a fictional park...

The purpose of this homework is to test your knowledge of GUI. Consider a fictional park where the entry price for 1 adult ticket is $50, and for 1 children ticket is $25. Write a simple GUI application that let user to enter the number of tickets and display the total price. The GUI should contain:

● One text field for the user to enter the number of adult tickets

● One text field for the user to enter the number of children tickets

● One button “Calculate total cost”

● One text field to display the total cost When the user clicks the button then the correct cost is displayed in the total price field. If the input text field is empty then it should be treated as 0 tickets.

In: Computer Science

// Lab Homework 11 // Logical Operator AND and OR // Demonstrate how to use a...

// Lab Homework 11
// Logical Operator AND and OR
// Demonstrate how to use a logical operator
// with a Boolean expression.

#include <iostream>
#include <cctype> // for tolower()
using namespace std;

int main()
{
   int numberOfCreditHours; // Number of credit hours student has completed
   float gpa; // The student's cumulative grade point average

   // Ask the user two questions:
   cout << "Answer the following questions:" << endl << endl;

   cout << "How many credit hours have you completed (0-200): ";
   cin >> numberOfCreditHours;

   cout << "What is your cumulative GPA (0.00-4.00)? ";
   cin >> gpa;

   cout << endl;

   // TODO: Students can petition for graduation if:
   // - they have completed 48+ credit hours
   // - they have a GPA of 2.0 or greater
   //
   // Use Logical operators in complex logical expressions to decide which of the following
   // four messages to print:
   //
   // 1) You may petition for graduation.
   // 2) You must raise your GPA before you can graduate.
   // 3) You must complete more credit hours before you can graduate.
   // 4) You must raise your GPA and complete more credits before graduating.
   //
   // Use just ONE of the logical operators below in the expression
   // to choose the approprate message. You MAY use the chosen operator
   //       more than once.
   //
   // Logical AND: &&
   // Logical OR: ||
   //
   // Note: Do NOT worry about situations where the user doesn't enter Y, y, N, or n

   // Use the if structure provided below.

   if // (<write a compound logic expression here for graduating>)
       //graduation message

   else if // (<write a compound logic expression here for too low gpa>)
       //raise gpa message

   else if // (<write a compound logic expression here for too few credits>)
       //complete more credits message

   else // else is good enough, no logic expression needed - it's the only other possibility
       // raise gpa and earn more credits message

   cout << endl << endl;

   return 0;
}

/* Sample interaction and output:

Test #1
==========================================
Answer the following questions:

How many credit hours have you completed (0-200): 60
What is your cumulative GPA (0.00-4.00)? 3.75

You may petition for graduation.

Press any key to continue . . .

Test #2
==========================================
Answer the following questions:

How many credit hours have you completed (0-200): 60
What is your cumulative GPA (0.00-4.00)? 1.99

You must raise your GPA before you can graduate.

Press any key to continue . . .

Test #3
==========================================
Answer the following questions:

How many credit hours have you completed (0-200): 47
What is your cumulative GPA (0.00-4.00)? 3.25

You must complete more credit hours before you can graduate.

Press any key to continue . . .

Test #4
==========================================
Answer the following questions:

How many credit hours have you completed (0-200): 45
What is your cumulative GPA (0.00-4.00)? 1.75

You must raise your GPA and complete more credits before graduating.

Press any key to continue . . .

*/

In: Computer Science

Prove that 2n+10 +n is O(2n)

Prove that 2n+10 +n is O(2n)

In: Computer Science

Make a program that swaps the three values. Three integer values are taken from the user...

  • Make a program that swaps the three values.
    • Three integer values are taken from the user input.
      • This work will be done by calling the function "getinput(num1, num2, num3)"
    • The input values are swapped each other by calling the function swap(num1, num2, num3)
      • example: values (a, b, c) will be (c, a, b) after the swap.
        • a = 10; b = 20; c = 30;
        • after function call,
          • a has 30, b has 10, and c has 20.

In: Computer Science

Please create (if not already in your linux home directory) files of any type. Once these...

Please create (if not already in your linux home directory) files of any type. Once these files are created, archive them, compress the archive and move these files to the thrash directory. This could be a script to be run from the shell or the script to be run from an executable file.

Submit your code and clearly explain all steps of your script.

In: Computer Science

Write pseudocode for quick find algorithm anf quick union algorithm Write pseudocode for quick find algorithm...

Write pseudocode for quick find algorithm anf quick union algorithm

Write pseudocode for quick find algorithm and quick union algorithm

In: Computer Science

quicksort the array step by step 63,19,32,11,87,3,87,24,48,39

quicksort the array step by step

63,19,32,11,87,3,87,24,48,39

In: Computer Science

Create a generic method to print objects in java. Include a tester class.

Create a generic method to print objects in java. Include a tester class.

In: Computer Science

Linux Create a simple 'user' file -user name, user id, some few other fields (at your...

Linux

Create a simple 'user' file -user name, user id, some few other fields (at your discretion). Name it 'users'. Enter about 10 entries there.

Create a simple 'user_data' file -user name, phone, address etc at your discretion.. User names in both files should match. So there would be 10 users in both files. You probably want to do these files as tab -separated, rather than space separated.

In: Computer Science

Why was the class-ful IP addressing scheme changed to class-less (CIDR) addressing?

Why was the class-ful IP addressing scheme changed to class-less (CIDR) addressing?

In: Computer Science

Discuss the inherent differences between ARP and NDP and what if any security vulnerabilities they have...

Discuss the inherent differences between ARP and NDP and what if any security vulnerabilities they have in common.

In: Computer Science

Write a brief description of a vulnerability found in the scan, including the operating system on...

  1. Write a brief description of a vulnerability found in the scan, including the operating system on which it was found, its risk factor, and its CVSS scores.
  2. Are the results of default scans different than the credentialed scan?
  3. Why might that be?
  4. What types of vulnerabilities might an attacker without any credentials be able to identify and exploit?
  5. This was a simple three computer LAN. How much more complicated would this process be for 100 computers? What about an enterprise with 10,000 computers on their LAN/WAN?
  6. Consider a cloud-hosted Infrastructure as a Service (IaaS) environment with many new, internet-accessible systems regularly being built and brought online. What advantages or challenges might there be with regard to vulnerability management in the cloud?

In: Computer Science

Make a function that swaps the values that change the values between the parameters as the...

  • Make a function that swaps the values that change the values between the parameters as the following rule.

  • The functions swap takes 2, 3 or 4 parameters and these functions are implemented as the overloading functions.

    • swap(int &, int &) : change the values each other.
      swap(int &, int &, int &) : change the value with the order. [min, medium, max]
      swap(int &, int &, int &, int &) : change the value like circular-shift-right [A, B, C, D] = > [B, C, D, A]
    • For Example,
      • num1 = 15; num2 = 5; num3 = 30; num4 =40;
      • swap(num1, num2);
        • num1 will be 5 and num2 will be 15
      • swap(num1, num2, num3)
        • num1 will be 5, num2 will be 15, and num3 is 30
      • swap(num1, num2, num3, num4)
        • num1 is 5, num2 is 30, num3 is 40 and num4 is 15

In: Computer Science