Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> problem z wykonaniem kodu js w pliku php
migotka1
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 17.09.2006

Ostrzeżenie: (0%)
-----


wklejam kod j.s. (zmiana koloru tła komórki po wskazaniu myszką):

onmouseover="this.style.background='#66CCFF';return true;"
style="CURSOR: hand"onmouseout="
this.style.background='white';return true;"
" title="Zobacz w manualu php" target="_manual

do pliku php w znaczniku <td> :

  1. <?
  2.  '
  3. <table><tr>
  4. <td onmouseover="this.style.background='#66CCFF';return true;"
  5. style="CURSOR: hand"onmouseout="this.style.background='white';return true;">jakiś tekst</td><tr></table>
  6. ';
  7. ?>

i nie działa! chyba coś ze składnią, bo w zwykłym pliku html jest ok
Proszę o wskazówki, dzięki dzięki

Ten post edytował migotka1 17.09.2006, 11:57:46
Go to the top of the page
+Quote Post
bogdan89
post
Post #2





Grupa: Zarejestrowani
Postów: 320
Pomógł: 36
Dołączył: 28.08.2006
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


przed każdym pojedyńczym apostrofem wstaw \

powinno pomóc (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
k110
post
Post #3





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 27.08.2006

Ostrzeżenie: (0%)
-----


echo
'
<table><tr>
<td onmouseover="this.style.background='#66CCFF';return true;"
style="CURSOR: hand"onmouseout="this.style.background='white';return true;">jakiś tekst</td><tr></table>
';
?>

możesz zamienić na np.
this.style.background=\'white\';return true;

PS. A nie lepiej zamiast echo po prostu

php coś tam ?> KOD HTML <? dalej php

Pozdrawiam

<?
echo
'
<table><tr>
<td onmouseover="this.style.background=\'#66CCFF\';return true;"
style="CURSOR: hand"onmouseout="this.style.background=\'white\';return true;">jakiś tekst</td><tr></table>
';
?>

lub

  1. <?
  2. //kod php
  3. ?>
  4. <table><tr>
  5. <td onmouseover="this.style.background='#66CCFF';return true;"
  6. style="CURSOR: hand"onmouseout="this.style.background='white';return true;">jakiś tekst</td><tr></table>
  7. <?
  8. //kod php
  9. ?>


Ten post edytował k110 17.09.2006, 12:04:32
Go to the top of the page
+Quote Post
migotka1
post
Post #4





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 17.09.2006

Ostrzeżenie: (0%)
-----


Proste i genialne. Dzięki K110 i bogdan89!!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.09.2025 - 20:24