ทาวเฮ้าส์ให้เช่า 310.152 ซอยรามคำแหง 72 TOWNHOUSE FOR RENT เนื้อที่ 18 ตร.ม บางกะปิ
People - หน้าแรก (Preview)
People
หน้าแรก
บทความ
สมาชิก
จัดการ
ยินดีต้อนรับสู่ People
แพลตฟอร์มเขียนบล็อกที่ทันสมัยและใช้งานง่าย พร้อมเครื่องมือที่ครบครันสำหรับการสร้างเนื้อหาที่น่าสนใจ
เริ่มอ่านบทความ
บทความเด่น
เนื้อหาที่น่าสนใจและมีคุณภาพ
กำลังโหลด...
คุณสมบัติเด่น
เครื่องมือที่ช่วยให้การเขียนบล็อกเป็นเรื่องง่าย
ตัวแก้ไข Rich Text
เครื่องมือเขียนที่ครบครัน เหมือน Microsoft Word แต่ใช้งานในเว็บ
จัดการรูปภาพ
อัปโหลดและจัดการรูปภาพได้ง่าย พร้อมระบบจัดเก็บที่ปลอดภัย
ระบบหมวดหมู่
จัดระเบียบเนื้อหาได้อย่างเป็นระบบ พร้อมระบบแท็กที่ยืดหยุ่น
แสดงความคิดเห็น
ความคิดเห็นของคุณ
ส่งความคิดเห็น
Blogger
แพลตฟอร์มเขียนบล็อกที่ทันสมัยและใช้งานง่าย
ลิงก์ด่วน
บทความทั้งหมด
สมาชิก
จัดการระบบ
© 2024 Blogger. สร้างด้วย ❤️
// Comment Form Submission
document.getElementById('commentForm').addEventListener('submit', async function(e) {
e.preventDefault();
const commentText = document.getElementById('commentText').value.trim();
const memberId = document.getElementById('memberId').value;
if (!commentText) {
alert('กรุณากรอกความคิดเห็น');
return;
}
try {
const response = await fetch('/comments/front/add', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
comment_text: commentText,
member_id: memberId
})
});
const result = await response.json();
if (result.success) {
alert('เพิ่มความคิดเห็นสำเร็จ');
document.getElementById('commentText').value = '';
} else {
alert(result.message || 'เกิดข้อผิดพลาดในการส่งความคิดเห็น');
}
} catch (error) {
console.error('Error:', error);
alert('เกิดข้อผิดพลาดในการเชื่อมต่อ');
}
});
// Load posts from API
async function loadPosts() {
try {
const response = await fetch('/posts');
const data = await response.json();
const posts = data.data || [];
const container = document.getElementById('postsContainer');
if (posts.length === 0) {
container.innerHTML = `ยังไม่มีบทความในระบบ`;
return;
}
container.innerHTML = posts.slice(0, 6).map(post => `
${post.title || 'ไม่มีชื่อ'}
${post.content ? post.content.replace(/]*>/g, '').substring(0, 100) + '...' : 'ไม่มีเนื้อหา'}
${new Date().toLocaleDateString('th-TH')}
อ่านต่อ
`).join('');
} catch (error) {
console.error('Error loading posts:', error);
document.getElementById('postsContainer').innerHTML = `เกิดข้อผิดพลาดในการโหลดข้อมูล`;
}
}
document.addEventListener('DOMContentLoaded', loadPosts);
ลิงค์แชร์ ประกาศทาวน์เฮ้าส์ รายการนี้