PHP and Javascript escape character problem, --> those wholike to solve things can try to solve t

PHP and Javascript escape character problem, --> those wholike to solve things can try to solve t

am 02.11.2009 09:53:29 von acetrader

Hi there,

I am doing an application that allows me to create RSS channels and put
feeds inside of each channel. Everything works so far, but - now I have
started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and 'Delete
Feed' functionalities and have run into a problem. For me its a big problem
cause Im not a guru programmer but for you out there it may be a piece of
cake.

I have the following line of code:

$myFeedHTML .= " $feedItemImagePath


onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />
/>DELETE
";

In $myFeedHTML I'am always appending new HTML data to it, in this case I'am
appending a table row/header row that has an image in it and underneath the
image it has two buttons, one is for the EDIT functionality and the other is
for the DELETE functionality.

Now... notice the onClik events ->
onClik='javascript:DeleteChannelAndAllOfItsFeeds()' . I ususally use that
method to call a javascript function from within a button or a link....and
like this is works (on its own - ie when its not being appended as a normal
string to the variable $myFeedHTML).

But...When it is appended to a variable so that I echo everything at once in
the end, the onClik action must be included inside a " (double quotes) and
inside ' (single quotes) so that it can be appeneded to the string, now
when this is being done everything gets mixed because of of all the " and '
thus the program thinks that these are normal escape characters and just
skips over the javascript call function that is nested within the onClik
event. So the onClik is not getting a function assigned to it. (you can see
this in the code I've pasted above)

What can I do in order to append it to my $myFeedHTML variable and at the
same time have it assigend a javascript function inside of its EDIT/DELETE
button onClik event ?

Can you give me some example maybe etc ?

Image Preview:

http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.j pg

btw: I know I've written onClik wrong but I wrote it this way in this forum
cause it wouldn't let me post my thread because it regards it as an illegal
tag lol. B-)B-)

Thank you very much :) ,
The Ace


--
View this message in context: http://old.nabble.com/PHP-and-Javascript-escape-character-pr oblem%2C---%3E-those-who-like-to-solve-things-can-try-to-sol ve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627 .html
Sent from the PHP - General mailing list archive at Nabble.com.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP and Javascript escape character problem, --> those who

am 02.11.2009 10:49:35 von Devendra Jadhav

--001636d3395995d9670477604b24
Content-Type: text/plain; charset=ISO-8859-1

Hey,
You can do it this way as well
$myFeedHTML .= " $feedItemImagePath


onClik=\"javascript:
>
> DeleteChannelAndAllOfItsFeeds()\" />
> />DELETE
";


So you can escape double quotes by \ (slash)
try this .. It will work...
you can escape any special character that you want to use as it is by
prepend it by \

On Mon, Nov 2, 2009 at 2:23 PM, acetrader wrote:

>
> Hi there,
>
> I am doing an application that allows me to create RSS channels and put
> feeds inside of each channel. Everything works so far, but - now I have
> started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and 'Delete
> Feed' functionalities and have run into a problem. For me its a big problem
> cause Im not a guru programmer but for you out there it may be a piece of
> cake.
>
> I have the following line of code:
>
> $myFeedHTML .= " $feedItemImagePath

>
> onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />
> />DELETE
";
>
> In $myFeedHTML I'am always appending new HTML data to it, in this case I'am
> appending a table row/header row that has an image in it and underneath the
> image it has two buttons, one is for the EDIT functionality and the other
> is
> for the DELETE functionality.
>
> Now... notice the onClik events ->
> onClik='javascript:DeleteChannelAndAllOfItsFeeds()' . I ususally use
> that
> method to call a javascript function from within a button or a link....and
> like this is works (on its own - ie when its not being appended as a normal
> string to the variable $myFeedHTML).
>
> But...When it is appended to a variable so that I echo everything at once
> in
> the end, the onClik action must be included inside a " (double quotes) and
> inside ' (single quotes) so that it can be appeneded to the string, now
> when this is being done everything gets mixed because of of all the " and '
> thus the program thinks that these are normal escape characters and just
> skips over the javascript call function that is nested within the onClik
> event. So the onClik is not getting a function assigned to it. (you can see
> this in the code I've pasted above)
>
> What can I do in order to append it to my $myFeedHTML variable and at the
> same time have it assigend a javascript function inside of its EDIT/DELETE
> button onClik event ?
>
> Can you give me some example maybe etc ?
>
> Image Preview:
>
> http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.j pg
>
> btw: I know I've written onClik wrong but I wrote it this way in this forum
> cause it wouldn't let me post my thread because it regards it as an illegal
> tag lol. B-)B-)
>
> Thank you very much :) ,
> The Ace
>
>
> --
> View this message in context:
> http://old.nabble.com/PHP-and-Javascript-escape-character-pr oblem%2C---%3E-those-who-like-to-solve-things-can-try-to-sol ve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627 .html
> Sent from the PHP - General mailing list archive at Nabble.com.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Devendra Jadhav

--001636d3395995d9670477604b24--

Re: PHP and Javascript escape character problem, --> thosewho like to solve things can try to sol

am 02.11.2009 12:08:09 von Ashley Sheridan

--=-/dZEr6oOFAonEEdHwmns
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Mon, 2009-11-02 at 00:53 -0800, acetrader wrote:

> Hi there,
>
> I am doing an application that allows me to create RSS channels and put
> feeds inside of each channel. Everything works so far, but - now I have
> started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and 'Delete
> Feed' functionalities and have run into a problem. For me its a big problem
> cause Im not a guru programmer but for you out there it may be a piece of
> cake.
>
> I have the following line of code:
>
> $myFeedHTML .= " $feedItemImagePath

>
> onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />
> />DELETE
";
>
> In $myFeedHTML I'am always appending new HTML data to it, in this case I'am
> appending a table row/header row that has an image in it and underneath the
> image it has two buttons, one is for the EDIT functionality and the other is
> for the DELETE functionality.
>
> Now... notice the onClik events ->
> onClik='javascript:DeleteChannelAndAllOfItsFeeds()' . I ususally use that
> method to call a javascript function from within a button or a link....and
> like this is works (on its own - ie when its not being appended as a normal
> string to the variable $myFeedHTML).
>
> But...When it is appended to a variable so that I echo everything at once in
> the end, the onClik action must be included inside a " (double quotes) and
> inside ' (single quotes) so that it can be appeneded to the string, now
> when this is being done everything gets mixed because of of all the " and '
> thus the program thinks that these are normal escape characters and just
> skips over the javascript call function that is nested within the onClik
> event. So the onClik is not getting a function assigned to it. (you can see
> this in the code I've pasted above)
>
> What can I do in order to append it to my $myFeedHTML variable and at the
> same time have it assigend a javascript function inside of its EDIT/DELETE
> button onClik event ?
>
> Can you give me some example maybe etc ?
>
> Image Preview:
>
> http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.j pg
>
> btw: I know I've written onClik wrong but I wrote it this way in this forum
> cause it wouldn't let me post my thread because it regards it as an illegal
> tag lol. B-)B-)
>
> Thank you very much :) ,
> The Ace
>
>
> --
> View this message in context: http://old.nabble.com/PHP-and-Javascript-escape-character-pr oblem%2C---%3E-those-who-like-to-solve-things-can-try-to-sol ve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627 .html
> Sent from the PHP - General mailing list archive at Nabble.com.
>
>


I've noticed also that in your code you've always referred to onclik,
when it should be onclick. I hope this was just a typo in the email!

Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-/dZEr6oOFAonEEdHwmns--

Re: PHP and Javascript escape character problem, --> those who

am 02.11.2009 12:18:01 von Stut

2009/11/2 Ashley Sheridan :
> On Mon, 2009-11-02 at 00:53 -0800, acetrader wrote:
>
>> Hi there,
>>
>> I am doing an application that allows me to create RSS channels and put
>> feeds inside of each channel. Everything works so far, but - now I have
>> started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and 'Del=
ete
>> Feed' functionalities and have run into a problem. For me its a big prob=
lem
>> cause Im not a guru programmer but for you out there it may be a piece o=
f
>> cake.
>>
>> I have the following line of code:
>>
>> $myFeedHTML .=3D        " #99CCFF'> $feedItemImagePath

>>
>> onClik=3D'javascript:DeleteChannelAndAllOfItsFeeds()' />
>> />DELETE
";
>>
>> In $myFeedHTML I'am always appending new HTML data to it, in this case I=
'am
>> appending a table row/header row that has an image in it and underneath =
the
>> image it has two buttons, one is for the EDIT functionality and the othe=
r is
>> for the DELETE functionality.
>>
>> Now... notice the onClik events ->
>> onClik=3D'javascript:DeleteChannelAndAllOfItsFeeds()'    . I u=
susally use that
>> method to call a javascript function from within a button or a link....a=
nd
>> like this is works (on its own - ie when its not being appended as a nor=
mal
>> string to the variable $myFeedHTML).
>>
>> But...When it is appended to a variable so that I echo everything at onc=
e in
>> the end, the onClik action must be included inside a " (double quotes) a=
nd
>> inside  ' (single quotes) so that it can be appeneded to the string=
, now
>> when this is being done everything gets mixed because of of all the " an=
d '
>> thus the program thinks that these are normal escape characters and just
>> skips over the javascript call function that is nested within the onClik
>> event. So the onClik is not getting a function assigned to it. (you can =
see
>> this in the code I've pasted above)
>>
>> What can I do in order to append it to my $myFeedHTML variable and at th=
e
>> same time have it assigend a javascript function inside of its EDIT/DELE=
TE
>> button onClik event ?
>>
>> Can you give me some example maybe etc ?
>>
>> Image Preview:
>>
>> http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.j pg
>>
>> btw: I know I've written onClik wrong but I wrote it this way in this fo=
rum
>> cause it wouldn't let me post my thread because it regards it as an ille=
gal
>> tag lol. B-)B-)
>>
>> Thank you very much :) ,
>> The Ace
>>
>>
>> --
>> View this message in context: http://old.nabble.com/PHP-and-Javascript-e=
scape-character-problem%2C---%3E-those-who-like-to-solve-thi ngs-can-try-to-=
solve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156 627.html
>> Sent from the PHP - General mailing list archive at Nabble.com.
>>
>>
>
>
> I've noticed also that in your code you've always referred to onclik,
> when it should be onclick. I hope this was just a typo in the email!

I've noticed also that you didn't read his email properly. I hope that
was just an oversight.

-Stuart

--=20
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP and Javascript escape character problem, --> those who

am 02.11.2009 12:21:16 von Devendra Jadhav

--001636c9353f80a45a0477619334
Content-Type: text/plain; charset=ISO-8859-1

Ashley Sheridan:
> btw: I know I've written onClik wrong but I wrote it this way in this
forum
> cause it wouldn't let me post my thread because it regards it as an
illegal
> tag lol. B-)B-)

:D


On Mon, Nov 2, 2009 at 4:38 PM, Ashley Sheridan wrote:

> On Mon, 2009-11-02 at 00:53 -0800, acetrader wrote:
>
> > Hi there,
> >
> > I am doing an application that allows me to create RSS channels and put
> > feeds inside of each channel. Everything works so far, but - now I have
> > started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and
> 'Delete
> > Feed' functionalities and have run into a problem. For me its a big
> problem
> > cause Im not a guru programmer but for you out there it may be a piece of
> > cake.
> >
> > I have the following line of code:
> >
> > $myFeedHTML .= "
> $feedItemImagePath

> >
> > onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />
> > />DELETE
";
> >
> > In $myFeedHTML I'am always appending new HTML data to it, in this case
> I'am
> > appending a table row/header row that has an image in it and underneath
> the
> > image it has two buttons, one is for the EDIT functionality and the other
> is
> > for the DELETE functionality.
> >
> > Now... notice the onClik events ->
> > onClik='javascript:DeleteChannelAndAllOfItsFeeds()' . I ususally use
> that
> > method to call a javascript function from within a button or a
> link....and
> > like this is works (on its own - ie when its not being appended as a
> normal
> > string to the variable $myFeedHTML).
> >
> > But...When it is appended to a variable so that I echo everything at once
> in
> > the end, the onClik action must be included inside a " (double quotes)
> and
> > inside ' (single quotes) so that it can be appeneded to the string, now
> > when this is being done everything gets mixed because of of all the " and
> '
> > thus the program thinks that these are normal escape characters and just
> > skips over the javascript call function that is nested within the onClik
> > event. So the onClik is not getting a function assigned to it. (you can
> see
> > this in the code I've pasted above)
> >
> > What can I do in order to append it to my $myFeedHTML variable and at the
> > same time have it assigend a javascript function inside of its
> EDIT/DELETE
> > button onClik event ?
> >
> > Can you give me some example maybe etc ?
> >
> > Image Preview:
> >
> > http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.j pg
> >
> > btw: I know I've written onClik wrong but I wrote it this way in this
> forum
> > cause it wouldn't let me post my thread because it regards it as an
> illegal
> > tag lol. B-)B-)
> >
> > Thank you very much :) ,
> > The Ace
> >
> >
> > --
> > View this message in context:
> http://old.nabble.com/PHP-and-Javascript-escape-character-pr oblem%2C---%3E-those-who-like-to-solve-things-can-try-to-sol ve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627 .html
> > Sent from the PHP - General mailing list archive at Nabble.com.
> >
> >
>
>
> I've noticed also that in your code you've always referred to onclik,
> when it should be onclick. I hope this was just a typo in the email!
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


--
Devendra Jadhav

--001636c9353f80a45a0477619334--

Re: PHP and Javascript escape character problem, --> thosewho like to solve things can try to so

am 02.11.2009 12:21:16 von Ashley Sheridan

--=-/sFQzabS7NTvjj+ywL4a
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Mon, 2009-11-02 at 16:51 +0530, Devendra Jadhav wrote:

> Ashley Sheridan:
> > btw: I know I've written onClik wrong but I wrote it this way in this
> forum
> > cause it wouldn't let me post my thread because it regards it as an
> illegal
> > tag lol. B-)B-)
>
> :D
>
>
> On Mon, Nov 2, 2009 at 4:38 PM, Ashley Sheridan wrote:
>
> > On Mon, 2009-11-02 at 00:53 -0800, acetrader wrote:
> >
> > > Hi there,
> > >
> > > I am doing an application that allows me to create RSS channels and put
> > > feeds inside of each channel. Everything works so far, but - now I have
> > > started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and
> > 'Delete
> > > Feed' functionalities and have run into a problem. For me its a big
> > problem
> > > cause Im not a guru programmer but for you out there it may be a piece of
> > > cake.
> > >
> > > I have the following line of code:
> > >
> > > $myFeedHTML .= "
> > $feedItemImagePath

> > >
> > > onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />
> > > />DELETE
";
> > >
> > > In $myFeedHTML I'am always appending new HTML data to it, in this case
> > I'am
> > > appending a table row/header row that has an image in it and underneath
> > the
> > > image it has two buttons, one is for the EDIT functionality and the other
> > is
> > > for the DELETE functionality.
> > >
> > > Now... notice the onClik events ->
> > > onClik='javascript:DeleteChannelAndAllOfItsFeeds()' . I ususally use
> > that
> > > method to call a javascript function from within a button or a
> > link....and
> > > like this is works (on its own - ie when its not being appended as a
> > normal
> > > string to the variable $myFeedHTML).
> > >
> > > But...When it is appended to a variable so that I echo everything at once
> > in
> > > the end, the onClik action must be included inside a " (double quotes)
> > and
> > > inside ' (single quotes) so that it can be appeneded to the string, now
> > > when this is being done everything gets mixed because of of all the " and
> > '
> > > thus the program thinks that these are normal escape characters and just
> > > skips over the javascript call function that is nested within the onClik
> > > event. So the onClik is not getting a function assigned to it. (you can
> > see
> > > this in the code I've pasted above)
> > >
> > > What can I do in order to append it to my $myFeedHTML variable and at the
> > > same time have it assigend a javascript function inside of its
> > EDIT/DELETE
> > > button onClik event ?
> > >
> > > Can you give me some example maybe etc ?
> > >
> > > Image Preview:
> > >
> > > http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.j pg
> > >
> > > btw: I know I've written onClik wrong but I wrote it this way in this
> > forum
> > > cause it wouldn't let me post my thread because it regards it as an
> > illegal
> > > tag lol. B-)B-)
> > >
> > > Thank you very much :) ,
> > > The Ace
> > >
> > >
> > > --
> > > View this message in context:
> > http://old.nabble.com/PHP-and-Javascript-escape-character-pr oblem%2C---%3E-those-who-like-to-solve-things-can-try-to-sol ve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627 .html
> > > Sent from the PHP - General mailing list archive at Nabble.com.
> > >
> > >
> >
> >
> > I've noticed also that in your code you've always referred to onclik,
> > when it should be onclick. I hope this was just a typo in the email!
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
>
>


oops, lol!

Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-/sFQzabS7NTvjj+ywL4a--

Re: PHP and Javascript escape character problem, --> thosewho like to solve things can try to sol

am 02.11.2009 12:26:51 von acetrader

lol thank you very much guys :) the escape character worked and now its
accepting my javascript functions, thank you all very much :)
:jumping::jumping:
--
View this message in context: http://old.nabble.com/PHP-and-Javascript-escape-character-pr oblem%2C---%3E-those-who-like-to-solve-things-can-try-to-sol ve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156680 .html
Sent from the PHP - General mailing list archive at Nabble.com.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP and Javascript escape character problem, --> those who

am 02.11.2009 12:28:29 von Devendra Jadhav

--005045015c3c467369047761ad03
Content-Type: text/plain; charset=ISO-8859-1

:)

On Mon, Nov 2, 2009 at 4:56 PM, acetrader wrote:

>
> lol thank you very much guys :) the escape character worked and now its
> accepting my javascript functions, thank you all very much :)
> :jumping::jumping:
> --
> View this message in context:
> http://old.nabble.com/PHP-and-Javascript-escape-character-pr oblem%2C---%3E-those-who-like-to-solve-things-can-try-to-sol ve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156680 .html
> Sent from the PHP - General mailing list archive at Nabble.com.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Devendra Jadhav

--005045015c3c467369047761ad03--