Reminder - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Reminder

Description:

story = p As I told you, span class='highlight' ' word1 /span has ... As I told you, Alice has submitted her assignment. But I didn't see it. ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 8
Provided by: ise60
Category:
Tags: reminder | told

less

Transcript and Presenter's Notes

Title: Reminder


1
Reminder
  • Project 2B due next Tue (Dec 2), 10pm

2
Tips on Project 2B
  • By placing the variable story in the header
    script, immediately after the start script tag
    and before any of the functions, you define a
    global variable which can be used by all
    functions.
  • Learn more about global and local variables
    http//www.webdevelopersnotes.com/tutorials/javasc
    ript/global_local_variables_scope_javascript.php3

3
The story variable
  • It is used to output the final story (in HTML
    format)
  • Comprised of variables (what the user inputted)
    and strings (other texts in your story, including
    HTML tags)
  • Treat HTML tags as texts. Try not to be
    distracted by them
  • A string and a variable is connected with
  • Close up each string, i.e., write them in a
    single line. If you want to break lines on the
    result page, use ltbr /gt inside the string.

4
The story variable (example)
  • story ltpgtAs I told you, ltspan
    classhighlightgt word1 lt/spangt has
    submitted ltspan classhighlightgt gender1
    lt/spangt assignment.lt/pgtltpgtBut I didnt see
    it.lt/pgt
  • By close up we mean do not leave white space
    during the assignment of story. Below is a wrong
    example
  • story ltpgtAs I told you, ltspan
    classhighlightgt word1 lt/spangt has
    submitted
  • ltspan classhighlightgt gender1 lt/spangt
    assignment.lt/pgt
  • ltpgtBut I didnt see it.lt/pgt

Close it up!
Close it up!
5
The story variable (example)
  • Assume the user inputs Alice to the text box with
    idword1 and specify in the drop-down list that
    Alice is a woman.
  • The value of gender1 will be her (refer to the
    instruction for how to do this), and the value of
    word1 will be Alice.

6
The story variable (example)
  • Now the value of story will be a whole string
    ltpgtAs I told you, ltspan classhighlightgtAlicelt/
    spangt has submitted ltspan classhighlightgtherlt/s
    pangt assignment.lt/pgtltpgtBut I didnt see it.lt/pgt
  • Output it by document.write(story) and it shows
    like
  • As I told you, Alice has submitted her
    assignment.
  • But I didnt see it.

the CSS style of highlight, bold, red
7
Tips on Project 2B
  • Before you assign the gender variable, make sure
    you have the following statement in the newStory
    function
  • var genderlist document.getElementById(the id
    of your drop-down list).value
Write a Comment
User Comments (0)
About PowerShow.com