Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
SZenC8158yThere is exactly one place where echoing JS is acceptable, that is with cross site requests. Besides that it serves no purpose other than showing the developer is an idiot.
-
saarloos288y@purpletoxicrain Javascript echoing is to echo Javascript code from php which will be executed by the client side Javascript engine.
Example:
<?php
$var = "John Doe";
echo "<script>alert('This is from Javascript echoed by PHP, $var') ;</script>"
?>
Will output in an alertbox:
This is from Javascript echoed by PHP, John Doe. -
ace4810068y@Letmecode no actually, not wordpress.. I'm working on building a new CMS with laravel and I've been getting the hang of building API's with adequate response codes and messages... And then comes this plugin that requires me to echo javascript as a response so it can continue the process.
@purpletoxicrain it's not only wrong, its ugly and makes no sense whatsoever.
Related Rants
Why the fuck should I echo javascript?
Why in fucks name you do not deal with JSON responses?
Plugin devs are either lazy, or simply stupid as fuck!
Ps: Or I'm actually crazy
undefined
js
file manager
json
ckeditor