| |

VerySource

 Forgot password?
 Register
Search
View: 1043|Reply: 8

JSP issues

[Copy link]

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-3 19:10:01
| Show all posts |Read mode
Why the following code must be defined with var, but not with int?
<SCRIPT language = JavaScript>
function Year_Month () {
    var now = new Date ();
    var yy = now.getYear ();
    var mm = now.getMonth () + 1;
    var cl = '<font color = "# 0000df">';
    if (now.getDay () == 0) cl = '<font color = "# c00000">';
    if (now.getDay () == 6) cl = '<font color = "# 00c000">';
    return (cl + yy + 'year' + mm + 'month </ font>');}
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

Post time: 2020-1-3 20:09:01
| Show all posts
You are a JS program. . Variables must use var. Use int in JAVA
Reply

Use magic Report

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-3 20:21:01
| Show all posts
Isn't var in vb?
And it said language = JavaScript
Reply

Use magic Report

0

Threads

12

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-3 23:06:01
| Show all posts
This is the javascript code, which is a scripting language on the client side and does not belong to jsp
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-4 17:00:01
| Show all posts
You should check out the JavaScript language books to see why you need to use var to define variables. JavaScript code is a scripting language on the client side, which is executed on the client side, while the Java language is run on the server side.
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-5 09:42:01
| Show all posts
Non-strongly typed language
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-5 13:00:01
| Show all posts
This is JavaScript
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-7 09:39:01
| Show all posts
This is javaScript, which has nothing to do with java. This is how variables are declared in JavaScript, jsp! = JavaScript,
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-2 22:30:01
| Show all posts
O(∩_∩)O~, I just learned to confuse js with jsp
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list