Jump to content


[JS/HTML] Function won't work


8 replies to this topic

#1 Slightly Wonky Robob

    Not a Wonky Gent.

  • Administrator
  • 9333 posts

Posted 26 July 2008 - 00:02

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.

Posted Image
F O R T H E N S
Posted Image

#2 G-sus

    batshit insane

  • Member
  • 802 posts
  • Projects: Coding Skynet

Posted 26 July 2008 - 09:56

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.

Posted Image
(Sig by The DR)

True beauty comes from heart and mind.
(but perfection has also big boobs)

#3 Slightly Wonky Robob

    Not a Wonky Gent.

  • Administrator
  • 9333 posts

Posted 26 July 2008 - 15:24

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
Posted Image
F O R T H E N S
Posted Image

#4 G-sus

    batshit insane

  • Member
  • 802 posts
  • Projects: Coding Skynet

Posted 26 July 2008 - 15:36

well, other than that they´re completely the same, so i dont see a reason why they act different...
Posted Image
(Sig by The DR)

True beauty comes from heart and mind.
(but perfection has also big boobs)

#5 Slightly Wonky Robob

    Not a Wonky Gent.

  • Administrator
  • 9333 posts

Posted 26 July 2008 - 15:43

That's what I was afraid of :/
Posted Image
F O R T H E N S
Posted Image

#6 CodeCat

    It's a trap!

  • Gold Member
  • 6111 posts

Posted 26 July 2008 - 15:46

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

Posted Image
Posted Image

Go dtiomsaítear do chód gan earráidí, is go gcríochnaítear do chláir go réidh. -Old Irish proverb

#7 Slightly Wonky Robob

    Not a Wonky Gent.

  • Administrator
  • 9333 posts

Posted 26 July 2008 - 15:48

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?
Posted Image
F O R T H E N S
Posted Image

#8 CodeCat

    It's a trap!

  • Gold Member
  • 6111 posts

Posted 26 July 2008 - 15:51

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

Posted Image
Posted Image

Go dtiomsaítear do chód gan earráidí, is go gcríochnaítear do chláir go réidh. -Old Irish proverb

#9 Slightly Wonky Robob

    Not a Wonky Gent.

  • Administrator
  • 9333 posts

Posted 26 July 2008 - 15:53

The 2 pages are exactly the same, except for that portion of the code.
Posted Image
F O R T H E N S
Posted Image



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users