Hi,
I have an ajax script that sends a request to a servlet for information to be inserted into a table cell. The servlet then handles the request and replies with something like this:
(I took the liberty of removing all the out.println tags)
<script language='javascript' src='whiteWine.js'></script>
<table align='center' border='0'>
<tr>
<td align='center'>
<img src='Images/Buttons/Small/left.png' id='leftButton' onclick='prevPicture()' onMouseOver="changeOver('leftButton')" onMouseOut="changeOut('leftButton')" >
<img src='Images/Buttons/Small/right.png' id='rightButton' onclick='nextPicture()' onMouseOver="changeOver('rightButton')" onMouseOut="changeOut('rightButton')" >
</td>
</tr>
<tr>
<td colspan='2' align='center'>
<img id='mainPicture' src='Images/Wines/White Wines/whiteWine01.png' />
</td>
</tr>
For some reason, however, all the scripts functions cannot be found on the page. If I attach the
<script language='javascript' src='whiteWine.js'></script>
on the page then the functions work, but they are used as polymorphism and incorrect information is shown. (There are 3 different scripts with the same named functions, but different implementations).
Is there a reason why ajax can't send across scripts?
Thanks,
-Ashton