ใช้ php เข็ค javascript ว่ามีการเปิดใช้ หรือ enable หรือไม่
เขียนเมื่อ 13 ปีก่อน โดย Ninenik Narkdeephp javascript enable
คำสั่ง การ กำหนด รูปแบบ ตัวอย่าง เทคนิค ลูกเล่น การประยุกต์ การใช้งาน เกี่ยวกับ php javascript enable
ไปที่
Copy
<?php echo "<script language="javascript">"; if(!isset($_GET['enable_js']) and $_GET['enable_js']!=1){ echo "window.location='?enable_js=1';"; } echo "</script>"; ?> <?php if($_GET['enable_js']==1){ echo "javascript is enabled"; }else{ echo "javascript is not enabled"; } ?>
สามารถนำไปประยุกต์ใช้ ร่วมกับ iframe ผ่าน ตัวแปร session ได้ดังนี้
ไฟล์ index.php
<?php session_start(); ?> <html> <head> <title></title> </head> <body> <iframe name="check_js" src="check_js.php" width="1" height="0" frameborder="0"> </iframe> <?php echo $_SESSION['ses_js_enable']; ?> </body> </html>
ไฟล์ check_js.php
<?php session_start(); echo "<script language="javascript">"; if(!isset($_GET['enable_js']) and $_GET['enable_js']!=1){ echo "top.check_js.location='check_js.php?enable_js=1';"; } echo "</script>"; ?> <?php if($_GET['enable_js']==1){ $_SESSION['ses_js_enable']="javascript is enabled"; }else{ $_SESSION['ses_js_enable']="javascript is not enabled"; } ?>
กด Like หรือ Share เป็นกำลังใจ ให้มีบทความใหม่ๆ เรื่อยๆ น่ะครับ

URL สำหรับอ้างอิง
Top
Copy
ขอบคุณทุกการสนับสนุน
![]()