Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- perbaikan setelah baca komen terbaru
- */
- if(isset($_GET['kosong'])){
- ?>
- <div id='kosong'>kosong</div>
- <script>
- document.getElementById('kosong').innerHTML=konten;
- //console.log(konten);
- </script>
- <?php
- die();
- }else{}
- if(isset($_POST['reg'])){
- echo "<h3>tulisan ini muncul saat ada post masuk</h3>".
- date("d-m-Y H:i:s");
- die();
- }else{}
- ?>
- <script src='js/jquery-1.9.min.js'></script>
- <button type='button' onclick='muncul1()'>klik disini agar muncul tulisan dibawah</button>
- <button type='button' onclick='muncul2()'>klik disini agar muncul tulisan di tab/window baru</button>
- <div id='konten' style='margin:40px;font-size:20px'>tulisan muncul disini</div>
- <script>
- url="005.php";
- counter=1;
- function muncul1(){
- $.post(url,
- {reg:1},function(tulis){
- $("#konten").html(tulis);
- });
- }
- function muncul2(){
- $.post(url,
- {reg:1},function(tulis){
- winName="win_"+counter;
- counter++;
- var myWindow = window.open(url+"?kosong=1", winName, "width=200, height=100");
- // isi=myWindow.document.getElementById('kosong');
- // console.log(isi);
- myWindow.konten=tulis;
- });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment