+ 1

I am a beginner And i just tried the given example, i wrote something wrong and not getting the output could anyone help me out

<Html> <head> <title>my try</title> <body> <string type="text/javasceipt"> alert("This page cannot be dispalyed!"); </string> </head> </body> </html>

15th Sep 2019, 4:32 PM
athira VK
athira VK - avatar
26 Respostas
+ 2
its script not string and fix javascript typo
15th Sep 2019, 4:40 PM
Taste
Taste - avatar
+ 4
First html tag is not written in Capital letter <html> And it's <script> tag...not <string> tag
16th Sep 2019, 7:23 PM
Aung Thiha
Aung Thiha - avatar
+ 3
in your code its written javasceipt, it should be javascript
15th Sep 2019, 4:48 PM
Taste
Taste - avatar
+ 3
Your head and body tags are wrongly placed.
15th Sep 2019, 9:47 PM
Petar Kosic
Petar Kosic - avatar
+ 1
<!DOCTYPE html> <html> <head> <title>my try</title> <body> <script type="text/javascript"> alert("This page cannot be dispalyed!"); </script> </head> </body> </html>
15th Sep 2019, 5:46 PM
athira VK
athira VK - avatar
+ 1
Try this:: <!DOCTYPE html> <html> <head> <title>my try</title> <head> <body> <script type="text/javascript"> alert("This page cannot be dispalyed!"); </script> </body> </html>
16th Sep 2019, 4:36 AM
Vibhor Silawat
0
How to fix javascript typo.. Can u xplain wid example
15th Sep 2019, 4:44 PM
athira VK
athira VK - avatar
0
Ok thank yu
15th Sep 2019, 4:54 PM
athira VK
athira VK - avatar
0
did you get an error "This page cannot be displayed!" ? because thats the entire program, show a pop up box with "This page cannot be displayed!" written on it.
15th Sep 2019, 5:22 PM
Taste
Taste - avatar
0
No it's showing some syntax error.. Line :1
15th Sep 2019, 5:23 PM
athira VK
athira VK - avatar
0
put <!DOCTYPE html> at the very top and change Html to html.
15th Sep 2019, 5:25 PM
Taste
Taste - avatar
0
Now it showa Uncaught synatax error:unexpected token <line :1
15th Sep 2019, 5:41 PM
athira VK
athira VK - avatar
0
put the code here, let us see
15th Sep 2019, 5:43 PM
Taste
Taste - avatar
0
nothing is wrong, i already tested it. try to change your editor or browser
15th Sep 2019, 5:56 PM
Taste
Taste - avatar
0
Ok... It isn't working in js but gives the out put when tried in html and css
15th Sep 2019, 6:00 PM
athira VK
athira VK - avatar
0
Yeah I fixed it... Bt still the same error... Doesn't show output in js
16th Sep 2019, 1:26 AM
athira VK
athira VK - avatar
0
Nope.. Not working Actually am typing it in JS so is there anything else to be added
16th Sep 2019, 4:46 AM
athira VK
athira VK - avatar
0
And jst a doubt to knw, why do we use <!DOCTYPE html> tag for?
16th Sep 2019, 4:48 AM
athira VK
athira VK - avatar
0
doctype will let the browser know which html version you're using. html means you're using html5 you cant type html in js. they're seperated for a reason, only put html in html tab, css in css tab, and js in js tab.
16th Sep 2019, 5:02 AM
Taste
Taste - avatar
0
Your extension is .html ? right Or .js?
16th Sep 2019, 7:28 PM
Vibhor Silawat