Click here to Skip to main content
15,887,416 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionJavascript Pin
amitkumar12788@gmail.com28-Apr-14 23:20
professionalamitkumar12788@gmail.com28-Apr-14 23:20 
AnswerRe: Javascript Pin
thatraja7-May-14 5:21
professionalthatraja7-May-14 5:21 
AnswerRe: Javascript Pin
Anurag Gandhi16-May-14 4:13
professionalAnurag Gandhi16-May-14 4:13 
QuestionShowing blank page on IE Pin
Subin Mavunkal23-Apr-14 22:09
Subin Mavunkal23-Apr-14 22:09 
AnswerRe: Showing blank page on IE Pin
vbmike24-Apr-14 6:26
vbmike24-Apr-14 6:26 
AnswerRe: Showing blank page on IE Pin
V.25-Apr-14 2:04
professionalV.25-Apr-14 2:04 
QuestionJQPlot legend styling [SOLVED] Pin
V.22-Apr-14 21:33
professionalV.22-Apr-14 21:33 
QuestionHelp with class assignment Pin
GeraldBlackmore22-Apr-14 17:56
GeraldBlackmore22-Apr-14 17:56 
I have been trying to add the salutation string to p id="salutation" I can't figure it out. I have to use a html and a script separate this is what I have for the HTML.

XML
<html>
<head>
    <title>Invitation</title>
    <meta charset="utf-8">

</head>

<body>

   <p id="salutation">
   </p>
   <p id="image"></p>
   <p>You are invited to my house for a Cynco de Mayo party May 5, 2014.
   </p>
   <p>Sincerely,</p>
   <p id="closingname"></p>

<script type="text/javascript" src="script\letter.js"></script>
</body>
</html>



And this is what I have for the .js:

C#
"use strict";

function greeting() {
    var textOne = "Dear";
    var name = "John";
    var punc = ",";
    document.write(textOne + name + punc);
}


function complete() {
    var yourName = "Gerald Blackmore";
    var img = "<img src='image/partyimage.jpg'>";
    greeting();
    document.write(img);
    document.write(yourName);


}

complete();


These are the teachers instructions:
Create the following web page and name it letter.html.





<html>
<head>
<title>Invitation</title>
<meta charset="utf-8">
</head>
<body>




You are invited to my house for a Cinco de Mayo party May 5, 2014.


Sincerely,



</body>
</html>
Download an image that is appropriate for a Cinco de Mayo celebration and save it in an appropriate place on your web site.
Create an external JavaScript file and name it letter.js. Add the appropriate <script> tag to letter.html to include this external JavaScript file.
In the external JavaScript file you are to create two functions and invoke them. The first function should:
Accept three arguments: a greeting, e.g. "Dear", "Hello", or "Greetings", first name, and any appropriate punctuation, such as "," or ":".
The function should return a single string that is the full salutation in greeting, first name, punctuation order, e.g., "Dear Mark:".
The second function should:
Accept three arguments, the salutation returned by the first function, the sender name which will be your name, and the image file name of your downloaded Cinco de Mayo image.
The function should then add the salutation string to the

paragraph.
The function should then add the downloaded Cinco de Mayo image to the

paragraph.
Finally, the function should add your name to the

paragraph


AnswerRe: Help with class assignment Pin
Peter Leow22-Apr-14 18:17
professionalPeter Leow22-Apr-14 18:17 
SuggestionRe: Help with class assignment Pin
Richard Deeming23-Apr-14 1:32
mveRichard Deeming23-Apr-14 1:32 
GeneralRe: Help with class assignment Pin
GeraldBlackmore24-Apr-14 16:37
GeraldBlackmore24-Apr-14 16:37 
AnswerRe: Help with class assignment Pin
vbmike24-Apr-14 6:12
vbmike24-Apr-14 6:12 
GeneralRe: Help with class assignment Pin
GeraldBlackmore24-Apr-14 16:38
GeraldBlackmore24-Apr-14 16:38 
Questionis it possible to get a value from another page using JavaScript language? Pin
Hakan Bulut21-Apr-14 21:43
Hakan Bulut21-Apr-14 21:43 
AnswerRe: is it possible to get a value from another page using JavaScript language? Pin
Blikkies21-Apr-14 21:55
professionalBlikkies21-Apr-14 21:55 
GeneralRe: is it possible to get a value from another page using JavaScript language? Pin
Hakan Bulut21-Apr-14 22:27
Hakan Bulut21-Apr-14 22:27 
GeneralRe: is it possible to get a value from another page using JavaScript language? Pin
Blikkies21-Apr-14 22:51
professionalBlikkies21-Apr-14 22:51 
GeneralRe: is it possible to get a value from another page using JavaScript language? Pin
Hakan Bulut22-Apr-14 0:13
Hakan Bulut22-Apr-14 0:13 
GeneralRe: is it possible to get a value from another page using JavaScript language? Pin
Hakan Bulut22-Apr-14 1:08
Hakan Bulut22-Apr-14 1:08 
QuestionRequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 9:36
professionalSuraj Sahoo | Coding Passion16-Apr-14 9:36 
AnswerRe: RequireJs Pin
ujjwal shukla16-Apr-14 20:46
ujjwal shukla16-Apr-14 20:46 
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 20:59
professionalSuraj Sahoo | Coding Passion16-Apr-14 20:59 
AnswerRe: RequireJs Pin
ujjwal shukla16-Apr-14 22:36
ujjwal shukla16-Apr-14 22:36 
GeneralRe: RequireJs Pin
Suraj Sahoo | Coding Passion16-Apr-14 22:41
professionalSuraj Sahoo | Coding Passion16-Apr-14 22:41 
GeneralRe: RequireJs Pin
Sibeesh KV24-Sep-14 18:31
professionalSibeesh KV24-Sep-14 18:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.