SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Firefox Issue (undefined entity)

    Hi all,

    I've got some code that generates a table and then inserts it into a div.

    Now I must stress this already works fine, but!

    When I insert either of the following:

    Code:
    <table width="600px" cellspacing="0" cellpadding="0" border="0" id="TableData">
    <tr class="DataHeader">
    	<td>IP</td>
    	<td>ISP</td>
    	<td>OS</td>
    	<td>Browser</td>
    	<td>Date</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>Firefox 1.5.0.1</td>
    	<td>25/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>Firefox 1.5.0.1</td>
    	<td>25/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>MSIE 6.0</td>
    	<td>29/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>MSIE 6.0</td>
    	<td>29/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>MSIE 6.0</td>
    	<td>29/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>MSIE 6.0</td>
    	<td>29/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>MSIE 6.0</td>
    	<td>30/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>MSIE 6.0</td>
    	<td>30/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>MSIE 6.0</td>
    	<td>30/08/2006</td>
    </tr>
    <tr class="DataRow">
    	<td>127.0.0.1</td>
    	<td>Netpresto Limited</td>
    	<td>WinXP</td>
    	<td>MSIE 6.0</td>
    	<td>30/08/2006</td>
    </tr>
    <tr class="DataPager">
    <td colspan="5">
    <b>0</b>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=1');">1</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=2');">2</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=3');">3</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=4');">4</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=5');">5</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=6');">6</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=7');">7</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=8');">8</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=9');">9</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=10');">10</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=11');">11</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=12');">12</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=13');">13</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=14');">14</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=15');">15</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=16');">16</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=17');">17</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=18');">18</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=19');">19</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=20');">20</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=21');">21</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=22');">22</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=23');">23</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=24');">24</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=25');">25</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=26');">26</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=27');">27</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=28');">28</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=29');">29</a>
    &nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','&Query=&Page=30');">30</a>
    &nbsp;</td>
    </tr>
    </table>
    or

    Code:
    <table width="600px" cellspacing="0" cellpadding="0" border="0" id="TableData"><tr class="DataHeader"><td>IP</td><td>ISP</td><td>OS</td><td>Browser</td><td>Date</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>Firefox 1.5.0.1</td><td>25/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>Firefox 1.5.0.1</td><td>25/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>29/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>29/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>29/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>29/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>30/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>30/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>30/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>30/08/2006</td></tr><tr class="DataPager"><td colspan="5"><b>0</b>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d1');">1</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d2');">2</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d3');">3</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d4');">4</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d5');">5</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d6');">6</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d7');">7</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d8');">8</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d9');">9</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d10');">10</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d11');">11</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d12');">12</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d13');">13</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d14');">14</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d15');">15</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d16');">16</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d17');">17</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d18');">18</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d19');">19</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d20');">20</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d21');">21</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d22');">22</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d23');">23</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d24');">24</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d25');">25</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d26');">26</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d27');">27</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d28');">28</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d29');">29</a>&nbsp;<a href="javascript:LoadTable('Location_ISPLookup','TableData','%26Query%3d%26Page%3d30');">30</a>&nbsp;</td></tr></table>
    I get an undefined entity error in the Firefox Javascript Console.

    Yet it is displayed and the javascript works on both IE and FF.

    Anyone have any idea's?


  2. #2
    SitePoint Addict jtrelfa's Avatar
    Join Date
    Oct 2004
    Location
    Troy, Mi
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The javascript console will often display CSS errors as well as JavaScript errors. Will you include the complete code or a reference to the website so I can take a look?

  3. #3
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its an offline site at the moment, but basically:

    Ajax code contacts a page, which returns html code for a table.
    Code:
    function LoadTable(type, id, arguments)
    {
    	var ajaxOb = generateAjaxObject();
    	if(!type)
    		type = '';
    	var url = '../resources/TableData/table.aspx?TableType=' + type + arguments + '&Random=' + Math.floor(Math.random()*11);
    	if(ajaxOb)
    	{
    		ajaxOb.onreadystatechange = function()
    		{
    			if(ajaxOb.readyState == 4)
    			{
    				if(ajaxOb.status == 200)
    				{
    					populateTable(ajaxOb.responseText, id)
    					//alert(ajaxOb.responseText);
    				}
    			}
    		};
    		ajaxOb.open('GET', url, true)
    		ajaxOb.send(null)
    	}
    	else
    	{
    		populateTable('<table width="600px" cellspacing="0" cellpadding="0"><tr><td>Unable to perform your request.</td></tr></table>',id);
    	}
    }
    then when the data is retrieved,

    Code:
    function populateTable(data, id)
    {
    	var tableContainer = document.getElementById(id);
    	if(tableContainer)
    	{
    		if(tableContainer.parentNode)
    			tableContainer.parentNode.innerHTML = data;
    	}
    }
    The html code is injected into the parent of the existing table.

    complete error in Javascript

    Code:
    Error: undefined entity
    Source File: http://localhost/WebStats/resources/TableData/table.aspx?TableType=Location_IPLookup&Query=&Page=0&Random=1
    Line: 1, Column: 1421
    Source Code:
    <table width="600px" cellspacing="0" cellpadding="0" border="0" id="TableData"><tr class="DataHeader"><td>IP</td><td>ISP</td><td>OS</td><td>Browser</td><td>Date</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>Firefox 1.5.0.1</td><td>25/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>Firefox 1.5.0.1</td><td>25/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>29/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>29/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>29/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>29/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>30/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>30/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>30/08/2006</td></tr><tr class="DataRow"><td>127.0.0.1</td><td>Netpresto Limited</td><td>WinXP</td><td>MSIE 6.0</td><td>30/08/2006</td></tr><tr class="DataPager"><td colspan="5"><b>0</b>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d1');">1</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d2');">2</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d3');">3</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d4');">4</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d5');">5</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d6');">6</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d7');">7</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d8');">8</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d9');">9</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d10');">10</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d11');">11</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d12');">12</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d13');">13</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d14');">14</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d15');">15</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d16');">16</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d17');">17</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d18');">18</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d19');">19</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d20');">20</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d21');">21</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d22');">22</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d23');">23</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d24');">24</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d25');">25</a>&nbsp;<a href="javascript:LoadTable('Location_IPLookup','TableData','%26Query%3d%26Page%3d26');">26</a>&nbsp;<a href="j----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^

    Thanks


  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've solved it,

    basically my &nbsp; was being rejected as a known entity, after changing that to &#160; no more errors.

    Since the table is dynamically created, my paging has &nbsp; after each page number, after changing that all is well.

    Thanks



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •