Page 1 of 1

Line of Code [Resolved]

Posted: Sun Nov 09, 2014 7:00 am
by Epiales
Okay, trying to write this code to work in my while loop, but can't get it working right...

Code: Select all

<button class="btn" onClick="$('#atknpc').w2popup()"><img src="images/arena.png" width="30" height="30" title="Attack '.$row['username']. '"></button>
any ideas?

code it needs to be in:

Code: Select all

echo '<td class="arenacharid">'.$row['id'].'</td><td class="arenacharname">'.$row['name'].'</td><td class="arenacharlevel">'.$row['level'].'</td><td class="arenacharhp">'.$row['hpoints'].'</td><td class="arenacharattack">'.$row['attack'].'</td><td class="arenachardefense">'.$row['defense'].'</td><td><center><img src="images/arena.png" width="30" height="30" title="Attack '.$row['name']. '"></center></td>';

Re: Line of Code

Posted: Sun Nov 09, 2014 4:22 pm
by Jackolantern
What is happening? An error? Working, but not correctly?

Re: Line of Code

Posted: Mon Nov 10, 2014 2:12 am
by Epiales
Jackolantern wrote:What is happening? An error? Working, but not correctly?
No error at all, but chops the page off so it won't display

Re: Line of Code

Posted: Mon Nov 10, 2014 6:52 am
by MikuzA
Epiales wrote:Okay, trying to write this code to work in my while loop, but can't get it working right...

Code: Select all

<button class="btn" onClick="$('#atknpc').w2popup()"><img src="images/arena.png" width="30" height="30" title="Attack '.$row['username']. '"></button>
any ideas?

code it needs to be in:

Code: Select all

echo '<td class="arenacharid">'.$row['id'].'</td><td class="arenacharname">'.$row['name'].'</td><td class="arenacharlevel">'.$row['level'].'</td><td class="arenacharhp">'.$row['hpoints'].'</td><td class="arenacharattack">'.$row['attack'].'</td><td class="arenachardefense">'.$row['defense'].'</td><td><center><img src="images/arena.png" width="30" height="30" title="Attack '.$row['name']. '"></center></td>';
I see that you have in your <button>-tag both " and ', and when you are using php to echo you are using '.
So what I suspect here is that it gets broken here>>

Code: Select all

onClick="$('#atknpc').w2popup()"
try this>

Code: Select all

onClick="$(\'#atknpc\').w2popup()"

Re: Line of Code

Posted: Mon Nov 10, 2014 7:49 am
by Epiales
MikuzA wrote:
Epiales wrote:Okay, trying to write this code to work in my while loop, but can't get it working right...

Code: Select all

<button class="btn" onClick="$('#atknpc').w2popup()"><img src="images/arena.png" width="30" height="30" title="Attack '.$row['username']. '"></button>
any ideas?

code it needs to be in:

Code: Select all

echo '<td class="arenacharid">'.$row['id'].'</td><td class="arenacharname">'.$row['name'].'</td><td class="arenacharlevel">'.$row['level'].'</td><td class="arenacharhp">'.$row['hpoints'].'</td><td class="arenacharattack">'.$row['attack'].'</td><td class="arenachardefense">'.$row['defense'].'</td><td><center><img src="images/arena.png" width="30" height="30" title="Attack '.$row['name']. '"></center></td>';
I see that you have in your <button>-tag both " and ', and when you are using php to echo you are using '.
So what I suspect here is that it gets broken here>>

Code: Select all

onClick="$('#atknpc').w2popup()"
try this>

Code: Select all

onClick="$(\'#atknpc\').w2popup()"

Great, worked perfectly. I always have issues with trying to do these links lol...Thank you!