[SOLVED] Script is not working. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

[SOLVED] Script is not working.

I’ve tried linking it externally too, but I keep getting a blank screen. I don’t know why. https://code.sololearn.com/WF4QKDS5wCJ2/?ref=app

30th Jul 2019, 6:09 PM
7Pineapple
7Pineapple - avatar
9 Answers
+ 4
You used alert("<h2 align=" center">..... "), you've and enclose all in single quotes, not double quotes: alert('<h2 align=" center">.....' )
30th Jul 2019, 8:02 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
+ 11
Sorry I am late... I was out today so I disn’t see the mention. Seems like this is solved :)
31st Jul 2019, 1:35 AM
JTLZ
30th Jul 2019, 7:03 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
+ 3
You forgot a document.write(), and in alerts and other elements outputting HTML, you've to enclose all in single quotes if you use double quotes for HTML, and vice versa. Still to work on, but now outputs
30th Jul 2019, 7:05 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
+ 3
Also, you try and use "plain" HTML styling for alert boxes, which is not allowed. Styling an alert box is an harder work: https://stackoverflow.com/questions/7853130/how-to-change-the-style-of-alert-box
30th Jul 2019, 7:20 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
+ 3
Please read back my first post ☺️
30th Jul 2019, 7:58 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
+ 2
well i found the other document.write() but I can’t find the other differences. Double quotation marks have been used everywhere.
30th Jul 2019, 8:00 PM
7Pineapple
7Pineapple - avatar
30th Jul 2019, 6:11 PM
7Pineapple
7Pineapple - avatar
+ 1
I can’t seem to find what you changed in the code. It’s exactly the same, except that it’s working now. Paolo De Nictolis 🤔
30th Jul 2019, 7:31 PM
7Pineapple
7Pineapple - avatar