The best thing you can keep in mind here is that PHP runs on the backend,
and jQuery runs on the front end.  In most cases php will run "first".  So
for example, if php generates an html page with some javascript on it, the
javascript, once it makes it to your browser, has access to everything on
the page (well, besides iframes with src attributes not in your domain, but
thats another topic) , whether php generated it or not.

Does that make sense and/or help at all?

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


                                                                       
  From:       Pkunzipula <pkunzip...@hotmail.com>                      
                                                                       
  To:         "jQuery (English)" <jquery-en@googlegroups.com>          
                                                                       
  Date:       06/25/2009 04:37 PM                                      
                                                                       
  Subject:    [jQuery] The Balance between PHP and JQuery              
                                                                       






Hello Everyone!

I am new to both PHP and JQuery, and I am running into conflict over
which language is right for which task.

For instance:

I have a simple content management system (PHP) which allows
administrators to add and update stories with a textarea form.

I then use PHP to retrieve the input from the textarea, find the new
line breaks and convert them to <p></p> tags.  It works.

I then use the JQuery selector $('#slide div p:first').addClass
('noIndent') to take indenting off the first paragraph of each story
where #slide and div are both hard-coded into the HTML, but the p is
generated by PHP.

It doesn't work.  Is it my syntax, or do I really have to use PHP to
generate the classes too?  Or do I need to back it up and use JQuery
instead to output the <p></p> tags?

I appreciate any effort to clarify this matter, and in the process,
could you give me some simple guidelines of where you draw the line
between PHP and JQuery?

Thanks for your time!

Arlen

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

Reply via email to