Changeset 34387

Show
Ignore:
Timestamp:
07/11/09 02:29:36 (4 years ago)
Author:
moriyoshi
Message:

m9

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/php/phpencode/phpencode.html

    r34386 r34387  
    3434        ); 
    3535    } 
     36    document.getElementById('runit').addEventListener( 
     37        'click', 
     38        function(e) { 
     39            var s; 
     40            s = document.createElement('script'); 
     41            s.id = Math.random(); 
     42            window.cb = function(val) { 
     43                document.body.removeChild(s); 
     44                if (typeof(val.error) != 'undefined') { 
     45                    alert(val.error); 
     46                } else { 
     47                    prompt("Result (stdout):", val.stdout); 
     48                } 
     49            }; 
     50            s.setAttribute('src', 'http://api.dan.co.jp/lleval.cgi?l=php&c=cb&s=' + encodeURIComponent(document.getElementById('result').value)); 
     51            s.setAttribute('type', 'text/javascript'); 
     52            document.body.appendChild(s); 
     53        }, 
     54        false 
     55    ); 
    3656}; 
    3757 
     
    5474<textarea id="result" style="width:100%;height:10em"></textarea> 
    5575</p> 
     76<input type="button" id="runit" value="Run this on LLEval" /> 
    5677</form> 
    5778</html>