Timeline for Is it considered bad practice to have PHP in your JavaScript
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 23, 2011 at 15:37 | comment | added | Ross Goddard | @GregGuida Not only what Matt said, but it works. While it may cause trouble down the line, it works today and can be done without much extra thought. | |
| Dec 23, 2011 at 0:28 | history | migrated | from stackoverflow.com (revisions) | ||
| Dec 22, 2011 at 17:12 | comment | added | rlemon | $divID = '#' . $element_id_value; - no problems with the selector boss ;) | |
| Dec 22, 2011 at 17:12 | comment | added | Greg Guida | @Matt I think that that is probably the best explanation | |
| Dec 22, 2011 at 17:10 | comment | added | Matt | @GregGuida: My guess would be that programmers are seldom used to dealing with client/ server architectures like you get in web development. They treat DB <-> PHP <-> HTML / JS / CSS as one, and don't fully understand what should go where, and how the layers should be separated. | |
| Dec 22, 2011 at 17:08 | comment | added | Raynos | Note that echoing static data in a config file can be easily avoided by having your environments all be setup in the same way. | |
| Dec 22, 2011 at 17:06 | comment | added | Greg Guida | In the rest of my imaginary php code I've already appended the # =) but seriously I agree that you're example is the better way to do it. It seems more natural to me to do it that way too. So why do we see it so often in places where it is not necessary? | |
| Dec 22, 2011 at 16:49 | history | answered | Matt | CC BY-SA 3.0 |