รบกวนช่วยหน่อยครับ ดึงchart จากไฟล์ B.php มาแสดงในไฟล์ A.php
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา รบกวนช่วยหน่อยครับ ดึงchart จากไฟล์ B.php มาแสดงในไฟล์ A.php
รบกวนช่วยหน่อยครับ ดึงchart จากไฟล์ B.php มาแสดงในไฟล์ A.php
เนื่องจากผมไม่มีพื้นฐานจาวาสคริ้ป ajax หรือ jquery น่ะครับ รบกวนหน่อยนะครับ
#ขอบคุณครับ

คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
ความคิดเห็นที่
1


ความคิดเห็นที่
2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ไฟล์ A.php <div class = "panel-body" > <form action= "" > <select name= "customers" onchange= "showCustomer(this.value)" > <option value= "" >เลือกปี</option> <option value= "2016" >2016</option> <option value= "2017" >2017</option> </select> </form> <br> <div id= "txtHint" >Customer info will be listed here...</div> </div> <script> function showCustomer(str) { var xhttp; if (str == "" ) { document.getElementById( "txtHint" ).innerHTML = "" ; return ; } xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { document.getElementById( "txtHint" ).innerHTML = this.responseText; } }; xhttp.open( "GET" , "B.php" str, true); xhttp.send(); } </script> |

ความคิดเห็นที่
3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ไฟล์ B.php <!DOCTYPE HTML> <html> <head> <title>CanvasJS Chart jQuery Plugin</title> <script type= "text/javascript" src= "http://canvasjs.com/assets/script/jquery-1.11.1.min.js" ></script> <script type= "text/javascript" src= "http://canvasjs.com/assets/script/jquery.canvasjs.min.js" ></script> <script type= "text/javascript" > window.onload = function () { //Better to construct options first and then pass it as a parameter var options = { title: { text: "Column Chart using jQuery Plugin" }, animationEnabled: true, data: [ { type: "column" , //change it to line, area, bar, pie, etc dataPoints: [ { x: 10, y: 10 }, { x: 20, y: 11 }, { x: 30, y: 14 }, { x: 40, y: 16 }, { x: 50, y: 19 }, { x: 60, y: 15 }, { x: 70, y: 12 }, { x: 80, y: 10 } ] } ] }; $( "#chartContainer" ).CanvasJSChart(options); } </script> </head> <body> <div id= "chartContainer" style= "height: 300px; width: 100%;" ></div> </body> </html> |

ความคิดเห็นที่
4

ขยายขนาดความสูงของ iframe ตามความสูงของเพจที่แสดง ด้วย jQuery
https://www.ninenik.com/content.php?arti_id=220 via @ninenik
หรือดูเกี่ยวกับ iframe คลิก
หรือไม่ก็แสดงในไฟล์ A.php แล้ว โดยใช้ ajax เปลี่ยนข้อมูลที่นำมาใช้ แล้ว แสดง chart ตามข้อมูลใหม่
หรือดูเกี่ยวกับ iframe คลิก
หรือไม่ก็แสดงในไฟล์ A.php แล้ว โดยใช้ ajax เปลี่ยนข้อมูลที่นำมาใช้ แล้ว แสดง chart ตามข้อมูลใหม่

ขอบคุณทุกการสนับสนุน
![]()