JScript: alert boxes not appearing
2 posters
IITDU Forum :: TechTalks :: Ask for Help
Page 1 of 1
JScript: alert boxes not appearing
I'm kinda newbie in JS and trying some basics. Going through Wrox's Beginning Jscript fourth edition.
I copied a piece of code from the book. Pasted them in notepad,saved it as .html and opened it with Firefox 5,like the book instructed. But the desired output is not there.
Below is my code -
The book says,
"Save the file to your hard drive as ch1_examp2.htm and then load it into your browser. When you load
the page, you should see the first paragraph, Paragraph 1, followed by a message box displayed by the
first script block. The browser halts its parsing until you click the OK button"
But there was no alert box. Instead,a page like below appeared.
Is there anything wrong with my code segment,or any other issue?
I copied a piece of code from the book. Pasted them in notepad,saved it as .html and opened it with Firefox 5,like the book instructed. But the desired output is not there.
Below is my code -
- Code:
<html>
<body bgcolor=”WHITE”>
<p>Paragraph 1</p>
<script type=”text/javascript”>
// Script block 1
alert(“First Script Block”);
</script>
<p>Paragraph 2</p>
<script type=”text/javascript”>
// Script block 2
document.bgColor = “RED”;
alert(“Second Script Block”);
</script>
<p>Paragraph 3</p>
</body>
</html>
The book says,
"Save the file to your hard drive as ch1_examp2.htm and then load it into your browser. When you load
the page, you should see the first paragraph, Paragraph 1, followed by a message box displayed by the
first script block. The browser halts its parsing until you click the OK button"
But there was no alert box. Instead,a page like below appeared.
Is there anything wrong with my code segment,or any other issue?
Last edited by BIT0220-Iftekhar on Fri Sep 09, 2011 5:15 am; edited 1 time in total
Re: JScript: alert boxes not appearing
happens when you directly copy code from pdf.
Replace ->”<- with ->"<-
Clue-
type shift + '
Replace ->”<- with ->"<-
Clue-
type shift + '
Re: JScript: alert boxes not appearing
well,I don't get your answer. Perhaps you worried about the quotation signs which didn't appear properly inside code tags.
Edit: I just got clarity of your answer. And it worked
I'm afraid I wouldn't have figured it out ever.
A is worth too little for this help.
Edit: I just got clarity of your answer. And it worked
I'm afraid I wouldn't have figured it out ever.
A is worth too little for this help.
Re: JScript: alert boxes not appearing
Nope. Perhaps you didn't notice the quotation marks were appearing inside your notepad code inappropriately.
Lets try another way.
I said, this happens when you copy code from pdf directly instead of typing.
And I said, replace
Replace ->”<- with ->"<-
Lets try some zooming.
open your code in notepad, and then select all, make the font 26.
Now, after
I hope then you will understand what I am talking about
Lets try another way.
I said, this happens when you copy code from pdf directly instead of typing.
And I said, replace
Replace ->”<- with ->"<-
Lets try some zooming.
open your code in notepad, and then select all, make the font 26.
Now, after
- Code:
<body bgcolor=”WHITE”>
I hope then you will understand what I am talking about
IITDU Forum :: TechTalks :: Ask for Help
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Tue Sep 29, 2015 2:45 pm by Sophiawood
» Cisco EHWIC SFP/GE WAN Card
Mon Sep 07, 2015 11:08 am by Sophiawood
» Huawei S1700-28GFR-4P-AC Price
Thu Jun 25, 2015 2:31 pm by Sophiawood
» teach yourself C++ / Herbert Schildt Solutions
Wed Jun 03, 2015 1:52 pm by Abdullah Al Noman
» teach yourself c by herbert schildt pdf
Wed May 13, 2015 11:01 pm by Raquib Ridwan
» ASA 5506X With Firepower ASA5506-K9
Fri Apr 10, 2015 4:31 pm by Sophiawood
» New Trends in Deal Business
Tue Feb 03, 2015 9:38 pm by nersoa
» PoE Power Allocation for WS-C2960S-24PS-L
Wed Nov 05, 2014 11:12 am by Sophiawood
» How to cure back pain
Fri Oct 31, 2014 7:15 pm by Bergen Guildford