EvilZone

Programming and Scripting => Web Oriented Coding => : m0l0ko April 27, 2014, 02:01:22 PM

: Online sandboxes
: m0l0ko April 27, 2014, 02:01:22 PM
Can you recommend some good online sandboxes for testing out scripts. I only recently started looking into this, heres a good one for javascript and CSS:
http://jsfiddle.net
it lets you select different frameworks (or pure js), and it lets you select whether the javascript is run onLoad, in the head, in the body etc. Thats pretty useful. I looked up PHP tester there, but haven't found any good ones yet. Theres plenty like this:
http://sandbox.onlinephpfunctions.com/
which don't have many extra features, to do plain PHP tests online I could just use w3schools.com. A PHP sandbox which lets you select different frameworks like CakePHP, and lets you test out ajax with different javascript frameworks, now that'd be useful. A big sandbox which combines HTML, CSS, javascript, PHP (and/or other server side languages) and XML would be excellent. For example, one that shows you exactly whats going on with ajax, or displays the output of XML generated by PHP.

Can you share the best online sandbox sites that you know of. Since I only started looking, the best one I know of is jsfiddle which is pretty sweet, but it doesn't let you test server side scripts.
: Re: Online sandboxes
: daxda April 27, 2014, 02:11:56 PM
I've posted some I encountered https://evilzone.org/found-it-on-the-webs/test-your-code-online/msg72095/#msg72095
: Re: Online sandboxes
: m0l0ko April 27, 2014, 02:54:10 PM
Nice. Do any of those let you call PHP functions with AJAX requests? That would be brilliant, there could be one field (textarea for inputting code) for the javascript, one for the HTML and a field for the PHP script that is to be called by the AJAX request. For the output, there could be the regular HTML output, and an additional diagnosis output field which shows you whats going on behind the scenes by displaying the the get/post and response headers and stuff like that. I see this jsfiddle site does let you test ajax requests, I haven't figured out how to use it yet though, it uses something called the echo API, I'm reading up on that.
: Re: Online sandboxes
: Daemon May 07, 2014, 05:07:50 AM
Nice. Do any of those let you call PHP functions with AJAX requests? That would be brilliant, there could be one field (textarea for inputting code) for the javascript, one for the HTML and a field for the PHP script that is to be called by the AJAX request. For the output, there could be the regular HTML output, and an additional diagnosis output field which shows you whats going on behind the scenes by displaying the the get/post and response headers and stuff like that. I see this jsfiddle site does let you test ajax requests, I haven't figured out how to use it yet though, it uses something called the echo API, I'm reading up on that.

Why dont you just test it on your local (or live) server? That's what I do, if i need to test a PHP page I create an output function and echo all my results then use a separate PHP page to call the script. If it works, delete the echo function and go from there. This would also allow you to test your AJAX script as well. The reason I avoid sandboxes is because I'm never sure when it's my code not working, or the sandbox phuxing with my code, ive had it happen twice before where I put something into a sandbox and it wouldn't work but tested it locally and it worked like a charm.
Just a suggestion, do with it as you will.

Good luck,
Daemon