aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Java Script-I'm not possible to refer the external .js Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Java Script-I Watch "Java Script-I New topic
Author

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

Arun C. Giridharan
Ranch Hand

Joined: Jul 11, 2010
Posts: 96
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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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("");


GenRocket - Experts at Building Test Data
Arun C. Giridharan
Ranch Hand

Joined: Jul 11, 2010
Posts: 96
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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Jul 11, 2010
Posts: 96
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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Jul 11, 2010
Posts: 96
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Script-I'm not possible to refer the external .js