 |
|
ไฟล์test1.php
Code (JavaScript)
Code
<pre><button class="source">View source</button><code class="language-html hljs "><span class="hljs-tag"><<span class="hljs-title">html</span>></span>
<span class="hljs-tag"><<span class="hljs-title">head</span>></span>
<span class="hljs-tag"><<span class="hljs-title">meta</span> <span class="hljs-attribute">charset</span>=<span class="hljs-value">"UTF-8"</span>></span>
<span class="hljs-tag"><<span class="hljs-title">title</span>></span>Document<span class="hljs-tag"></<span class="hljs-title">title</span>></span>
<span class="hljs-tag"></<span class="hljs-title">head</span>></span>
<span class="hljs-tag"><<span class="hljs-title">body</span>></span>
<span class="hljs-tag"></<span class="hljs-title">body</span>></span>
<span class="hljs-tag"></<span class="hljs-title">html</span>></span>
</code></pre>
<script type="text/javascript">
(function( $ ) {
$(function() {
$( "pre" ).each(function() {
var $div = $( this ),
$link = $( ".source", $div ),
html = $( "code", $div ).html();
$link.on( "click", function( e ) {
e.preventDefault();
var newWindow = window.open( "Test2.php", "code","location=1,status=1,scrollbars=1,width=400,height=400" )
จะส่งค่า html ไปที่ value ของ textarea
});
});
});
})( jQuery );
</script>
ไฟล์ Test2.php
Code
<textarea id=editor name=editor>
Tag : PHP, JavaScript, jQuery
|
ประวัติการแก้ไข 2017-11-09 23:15:17
|
 |
 |
 |
 |
Date :
2017-11-09 23:13:48 |
By :
siamza080 |
View :
630 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |