←  Code Block

Fallout Studios Forums

»

[JS/HTML] Function won't work

Slightly Wonky Robob's Photo Slightly Wonky Robob 26 Jul 2008

This will quite possibly drive my insane... so before I go mad, can someone take a look at this? I have 2 sets of code, both generated by php, and in theory should be exactly the same. They do both produce the same graphical results, but in the first, the javascript function works, in the second it doesn't. It's prboably one of 2 options; 1. I'm over looking something extremely obvious or 2. Javascript is just being weird as usual.

		<table width="90%" id="GImage_1">	
            <tr height="25px" valign="top">
            	<td rowspan="4" width="110px" align="center"><a href="index.php?img=1964">
	                <img src="image.php?id=1964&type=thumb" border="0" title="Image 1964" />
                </a></td>
                <td><strong>ID: </strong></td>
                <td style="color: #979f6b;">1</td>
                <td rowspan="2" width="500px" valign="middle" align="right">

                	<img src="site_images/up.jpg" title="Move Up" onclick="groupMoveAJAX(35, 1, &#39;up&#39;);" style="cursor:pointer;">
                </td>
			</tr>
            <tr height="25px" valign="top">
            	<td><strong>Title: </strong></td>
            	<td style="color: #979f6b;">14.jpg</td>
			</tr>
            <tr height="25px" valign="top">

            	<td><strong>Rank: </strong></td>
            	<td style="color: #979f6b;"></td>
                <td rowspan="2" width="500px" valign="middle" align="right">
                	<img src="site_images/down.jpg">
                </td>
			</tr>
            <tr height="25px" valign="top">
            	<td><strong>Rating: </strong></td>

            	<td style="color: #979f6b;">Unrated</td>
			</tr>
            <tr><td colspan="4" align="center">
            	<br /><div id="wikiTitle"></div><br />
            </td></tr>
        </table>  


<table width=&#34;90%&#34; id=&#34;GImage_1&#34;><tr height=&#34;25px&#34; valign=&#34;top&#34;><td rowspan=&#34;4&#34; width=&#34;110px&#34; align=&#34;center&#34;><a href=&#34;index.php?img=1965&#34;><img src=&#34;image.php?id=1965&type=thumb&#34; border=&#34;0&#34; title=&#34;Image 1965&#34; /></a></td><td><strong>ID&#58; </strong></td><td style=&#34;color&#58; #979f6b;&#34;>1</td><td rowspan=&#34;2&#34; width=&#34;500px&#34; valign=&#34;middle&#34; align=&#34;right&#34;><img src=&#34;site_images/up.jpg&#34; title=&#34;Move Up&#34; onclick=&#34;groupMoveAJAX&#40;35, 1, &#39;up&#39;&#41;;&#34; style=&#34;cursor&#58;pointer;&#34;></td></tr><tr height=&#34;25px&#34; valign=&#34;top&#34;><td><strong>Title&#58; </strong></td><td style=&#34;color&#58; #979f6b;&#34;>12.jpg</td></tr><tr height=&#34;25px&#34; valign=&#34;top&#34;><td><strong>Rank&#58; </strong></td><td style=&#34;color&#58; #979f6b;&#34;></td><td rowspan=&#34;2&#34; width=&#34;500px&#34; valign=&#34;middle&#34; align=&#34;right&#34;><img src=&#34;site_images/down.jpg&#34;></td></tr><tr height=&#34;25px&#34; valign=&#34;top&#34;><td><strong>Rating&#58; </strong></td><td style=&#34;color&#58; #979f6b;&#34;>Unrated</td></tr><tr><td colspan=&#34;4&#34; align=&#34;center&#34;><br /><div id=&#34;wikiTitle&#34;></div><br /></td></tr></table>


Anyone any ideas?
Edited by Bob, 26 July 2008 - 15:24.
Quote

G-sus's Photo G-sus 26 Jul 2008

as you know i dont have a clue about HTML or JSF, but shouldnt there be a "<" in front of ther first 'tr', in the first line...?
also, where the first refers a "14.jpg", the second refers to "12.jpg"...
Edited by G-sus, 26 July 2008 - 10:00.
Quote

Slightly Wonky Robob's Photo Slightly Wonky Robob 26 Jul 2008

View PostG-sus, on 26 Jul 2008, 10:56, said:

as you know i dont have a clue about HTML or JSF, but shouldnt there be a "<" in front of ther first 'tr', in the first line...?

Long story short, copypasta error (it has the " < " in the real version)

View PostG-sus, on 26 Jul 2008, 10:56, said:

also, where the first refers a "14.jpg", the second refers to "12.jpg"...

That is just because I copied the source of 2 different images, the same problem happens which ever image I use :D
Quote

G-sus's Photo G-sus 26 Jul 2008

well, other than that they´re completely the same, so i dont see a reason why they act different...
Quote

Slightly Wonky Robob's Photo Slightly Wonky Robob 26 Jul 2008

That's what I was afraid of :/
Quote

CodeCat's Photo CodeCat 26 Jul 2008

The only explanation I can think of is that the JS code itself is broken.
Quote

Slightly Wonky Robob's Photo Slightly Wonky Robob 26 Jul 2008

View PostCodeCat, on 26 Jul 2008, 16:46, said:

The only explanation I can think of is that the JS code itself is broken.

If that were so, why would the first instance work, and not the second?
Quote

CodeCat's Photo CodeCat 26 Jul 2008

Well you didn't post ALL the code of the page... there might be something we couldn't see.
Quote

Slightly Wonky Robob's Photo Slightly Wonky Robob 26 Jul 2008

The 2 pages are exactly the same, except for that portion of the code.
Quote