Hi all,
I was wondering if anyone could help me display the HTML in a javascript that displays a table of data of prototype cinema listings.
This code brings up a Syntax error: Object doesn't support this property or method on line 99
Any ideas, folks?
Jonnie -
<html>
-
<body>
-
-
<h2>Booking Summary Sheet</h2>
-
-
<script language = "javascript" text = "text/javascript">
-
-
// CustomerBooking class
-
function CustomerBooking(bookingId, customerName, film, showDate)
-
{
-
this.bookingId = bookingId;
-
this.customerName = customerName;
-
this.film = film;
-
this.showDate = showDate;
-
}
-
-
CustomerBooking.prototype.getBookingId = function()
-
{
-
return this.bookingId;
-
}
-
-
CustomerBooking.prototype.setBookingId = function(bookingId)
-
{
-
this.bookingId = bookingId;
-
}
-
-
CustomerBooking.prototype.getCustomerName = function()
-
{
-
return this.customerName;
-
}
-
-
CustomerBooking.prototype.setCustomerName = function(CustomerName)
-
{
-
this.customerName = customerName;
-
}
-
-
CustomerBooking.prototype.getFilm = function()
-
{
-
return this.film;
-
}
-
-
CustomerBooking.prototype.setFilm = function(film)
-
{
-
this.film = film;
-
}
-
-
CustomerBooking.prototype.showDate = function()
-
{
-
return this.showDate;
-
}
-
-
CustomerBooking.prototype.showDate = function(showDate)
-
{
-
this.showDate = showDate;
-
}
-
-
-
var firstBooking = new CustomerBooking(1234, "Robert Smith", "Raging Bull", "25 July 2004 18:20")
-
-
var secondBooking = new CustomerBooking(1244, "Arnold Palmer", "Toy Story", "27 July 2004 20:15")
-
-
document.write("First booking name is " + firstBooking.getCustomerName() + "<br>");
-
document.write("Second booking name is " + secondBooking.getCustomerName());
-
-
-
// cinema class
-
function cinema()
-
{
-
this.bookings = new Array();
-
}
-
-
cinema.prototype.addBooking = function(bookingId, customerName, film, showDate)
-
{
-
this.bookings[bookingId] = new CustomerBooking(bookingId, customerName, film, showDate);
-
}
-
-
// booking HTML
-
cinema.prototype.getBookingsTable = function()
-
{
-
var booking;
-
var bookingsTableHTML = "<table border = 1>";
-
-
for (booking in this.bookings)
-
{
-
bookingsTableHTML += "<tr><td>";
-
bookingsTableHTML += this.bookings[booking].getBookingId();
-
bookingsTableHTML += "</td>";
-
-
bookingsTableHTML += "<td>";
-
bookingsTableHTML += this.bookings[booking].getCustomerName();
-
bookingsTableHTML += "</td>";
-
-
bookingsTableHTML += "<td>";
-
bookingsTableHTML += this.bookings[booking].getFilm();
-
bookingsTableHTML += "</td>";
-
-
bookingsTableHTML += "<td>";
-
bookingsTableHTML += this.bookings[booking].getShowDate();
-
bookingsTableHTML += "</td>";
-
bookingsTableHTML += "</tr>";
-
}
-
bookingsTableHTML += "</table>";
-
return bookingsTableHTML;
-
}
-
-
-
var londonOdeon = new cinema();
-
-
londonOdeon.addBooking(342, "Arnold Palmer","Toy Story","15 July 2004 20:15");
-
londonOdeon.addBooking(335, "Louise Anderson","The Shawshank Redemption","27 July 2004 11:25");
-
londonOdeon.addBooking(566, "Catherine Hughes","Never Say Never","27 July 2004 17:55");
-
londonOdeon.addBooking(324, "Rob Gordon","Shrek","29 July 2004 20:15");
-
-
document.write(londonOdeon.getBookingsTable());
-
-
</script>
-
</body>
-
</html>
-
2 1877
u have no getShowDate() function.
your calling getShowDate(), but u named the function showDate()
change the function name: -
CustomerBooking.prototype.getShowDate = function(showDate)
-
good luck
Thank you!!!!
In a rare stroke of intuition for me i figured what I did wrong.
I did indeed incorrectly set my get and set methods changing from this: -
-
CustomerBooking.prototype.showDate = function()
-
{
-
return this.showDate;
-
}
-
-
CustomerBooking.prototype.showDate = function(showDate)
-
{
-
this.showDate = showDate;
-
}
-
to this: -
CustomerBooking.prototype.getShowDate = function()
-
{
-
return this.showDate;
-
}
-
-
CustomerBooking.prototype.setShowDate = function(showDate)
-
{
-
this.showDate = showDate;
-
}
-
I couldn't see that until now.
Thanks :D
Sign in to post your reply or Sign up for a free account.
Similar topics
by: annoyingmouse2002 |
last post by:
Hi there,
sorry if this a long post but I'm really just starting out. I've been
using MSXML to parse an OWL but would like to use a different
solution. Basically it reads the OWL (Based on XML)...
|
by: Halldor Isak Gylfason |
last post by:
I am faced with the task of porting a client application to a web
architecture platform, e.g. to make it browser based. The technology I
used was J2EE, e.g. servlets/JSP pages and HTML/javascript....
|
by: Jim, N2VX |
last post by:
I'd like to create/display an Excel spreadsheet from javascript. We
have an HTML page with results of a search and it can be reasonably
large.
The first attempt was to format the data into an...
|
by: Brett Baisley |
last post by:
Hello
I have a block of html code that I want to run by calling a javascript
function to print it. Its basically a table with menu items in it that is
the same for many pages, and instead of...
|
by: googlegroups |
last post by:
I have a large table in html created dynamically. This table can grow
to several hundred rows or more. I have the ability to hide or display
individual rows (using row.style.display = "none") and...
|
by: Michelle Keys |
last post by:
I am trying to call a print function to print a string from a database
using javascript.
Which is RC_DATA of Varchar2(2500).
This is a javascript is not being used. I have a thing that needs to...
|
by: e |
last post by:
I've been having an extremely difficult time finding an answer to this in IE
/ js groups, so I thought I'd try here.
I've got an aspx page that delivers loads of report data into custom-named...
|
by: bboyle18 |
last post by:
Hi,
I am working with a table sorting script which can be found here
http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting
This script works very nicely, but when there is a...
|
by: anthonybrough |
last post by:
I have an asp page that has a form to collect user data in a form.
when the user clicks submit the input is validated. If any fields are
not acceptable the user clicks on a button to go back to...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |