Login
·
Signup
Home
»
XtGem
»
Coding help
» How Display forum blog message in home page of site
Login to reply
·
From end
Rajsurya
Please provide me code
#
2018-02-04 18:54 ·
(0)
Graham
Rajsurya
This is a test of a script for displaying a forum thread on the home page using XHR javascript
If XHR is not supported normal forum should load
<div id="content" class="xt_container" style="display:none">
<!--content--><xt:forum /><!--content-->
</div>
Copy code
And then this
<script>
var thisPath = window.location.pathname;
// Adjust path to suit
if (thisPath == "/" || thisPath == "/index" && typeof ( new XMLHttpRequest())!=undefined){
// Change this for your own url
newPath = "/index/__xt/test/thread-oon8wg4ki2cqrt9e1bcdih8qa4ec2wkln9y1.html";
function loadContent(){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function(){
if (this.readyState == 4 && this.status == 200){
var content=this.responseText.split("<!--content-->");
document.getElementById("content").innerHTML = content[1];
document.getElementById("content").style.display = "block";}}
xhttp.open("GET", newPath, true);
xhttp.send();}
loadContent();}
else{
document.getElementById("content").style.display = "block";}
</script>
Copy code
DEMO
http://banana.madpath.com/
#
2018-02-08 21:14 ·
(0)
Rajsurya
Graham
Thank You Grahan Sir you are really good helping personality
#
2018-02-09 19:18 ·
(0)
Home
»
XtGem
»
Coding help
» How Display forum blog message in home page of site
Online: Guests: 1
Log in