Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
Javascript object
Sen George
Ranch Hand
Posts: 81
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please advise whether something is missing in the following simple code. Neither document.write prints anything. The window title displays correctly.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Object Creation</title> </head> <body> <h1>Car Objects</h1> <script type="text/javascript"> function carObject(vin, type, color, price) { this.vin = vin; this.type = type; this.color = color; this.price = price; } var car1 = new carObject(12345, "coupe", "blue", 20000); document.write(car1.vin + " | " + car1.type + " | " car1.color + " | " + car1.price + "<br><br>"); var car2 = {vin1:56789, type1:"sedan", color1:"green", price1:22000}; document.write(car2.vin1 + " | " + car2.type1 + " | " car2.color1 + " | " + car2.price1 + "<br><br>"); </script> </body> </html>
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Check the syntax of your write statements carefully. You made the same error on both of them.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Sen George
Ranch Hand
Posts: 81
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The simple document.write(car1.vin); is also not displaying. Please advise.
Eric Pascarello
author
Posts: 15385
6
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I think you need to install this:
http://www.getFirebug.com
Eric
Sen George
Ranch Hand
Posts: 81
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks for the error tip. I figured it out.
Eric, thanks for the Firebug lead. I need to figure out the way to start using it.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Help with displaying data properly
Add a link to submit button
Appending the data in frame or popup window
How Do I Access All of the src Attributes of All of the Images in a Web Page?
How do I Dynamically change Applet size.
More...