missing ) after argument ajax.updater

Discussion in 'JavaScript' started by ksquared3, Feb 1, 2011.

  1. ksquared3

    ksquared3 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #21
    Aiiiii. The code is lovely but it only does the decrement for the back button twice. I'm at a loss. How can I get that php code at the top to check $paintingBack more than twice? I would appreciate any help. Thank you.

    Here's the code:

    <?php
        $paintingBack=$paintingNumber-1;
        $paintingNext=$paintingNumber+1;
        if ($paintingBack < 1) {
        $paintingBack = $paintingBack + 1;
        }
        ?>
        <a href="" id="link1" class='link'><img src='images/braceL.gif' alt='brace' width='20' height='11' valign='text-bottom'/></a>
    	<script type="text/javascript">
    	var l = document.getElementById("link1");
    	l.onFocus = function() {
        if(this.blur)this.blur();
    	}
    	l.onclick = function() {
        document.getElementById("paintingImage").innerHTML = "<img src='images/painting_<? echo $paintingBack; ?>.jpg' />";
        return false;
    	}
    	</script>
         <a href="thumbnails.php" class="linkCurrent" target="_self" onFocus="if(this.blur)this.blur)" />PAINTINGS</a>
         <a href="painting_<?php echo $paintingNext; ?>.php" class="link" target="_self" onFocus="if(this.blur)this.blur()" /><img src="images/braceR.gif" alt="brace" width="20" height="14" valign="text-bottom" onFocus="if(this.blur)this.blur()" /></a>
    Code (markup):
     
    ksquared3, Feb 5, 2011 IP
  2. ksquared3

    ksquared3 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #22
    What I need to do is loop through this code.
    	<?php
        $paintingBack=$paintingNumber-1;
        $paintingNext=$paintingNumber+1;
        if ($paintingBack < 1) {
        $paintingBack = $paintingBack + 1;
        }
        ?>
        <a href="" id="link1" class='link'><img src='images/braceL.gif' alt='brace' width='20' height='11' valign='text-bottom'/></a>
    	<script type="text/javascript">
    	var l = document.getElementById("link1");
    	l.onFocus = function() {
        if(this.blur)this.blur();
    	}
    	l.onclick = function() {
        document.getElementById("paintingImage").innerHTML = "<img src='images/painting_<? echo $paintingBack; ?>.jpg' />";
        return false;
    	}
    	</script>
    Code (markup):
     
    ksquared3, Feb 5, 2011 IP