This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Script-I'm not possible to refer the external .js

 
Arun C. Giridharan
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not possible to refer the external .js.....



my .js file contents


<!--var name=prompt("who are you");
document.write("<h1>Hello World!</h1>");-->

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So...many....things....

1. Most of your relevant code is commented out. Why?

2. Where is hell.js in relation to your HTML file?

3. What is the prompt() function supposed to do and where is it defined?

4. Why do you have javascript in your HTML but no SCRIPT tags around it?\

5. Why do you have a space between number and 1? var number 1=prompt("");
 
Arun C. Giridharan
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.i just like to check in different ways....That's Y.

2.it's in same folder(.js file)

3.prompt it's defined .js file.

4.i have specified around script tags.

5. java script usually never considered about white space(ignores)....
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do realize it is 2010. If you are having to support browsers that don't support JavaScript, I feel for you.

1. ok

2. good deal

3. ok

4. Not in the code you showed us

5. Wrong.

Ok, so to the real problem here which is why can't hell.js be accessed. How do you know it isn't loading on the page? What are debugging methods? What errors are you getting? My advice would be to use Firefox with the Firebug plugin installed. It's a life saver when it comes to debugging JavaScript.
 
Arun C. Giridharan
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is Firebug plugin ?

I now it's 2010 with out <!-- some script content--> ....this i can't do operation with var.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arun Giridharan wrote:what is Firebug plugin ?


It's a plugin for Firefox that lets you do all sorts of nifty debugging things regarding HTML, JavaScript, and CSS. Google is your friend.
 
Arun C. Giridharan
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I now it's 2010 with out <!-- some script content--> ....this i can't do operation with var



if i mention the above code the output in browser is as shown below.

Hello qw
your Answer is1223 ...where num1 is 12 and num2 is 23.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic