Jump to content

Instant feed


smartin1017

Recommended Posts

Hi guys, I am trying to create a facebook like feed. I want people to be able to enter in comments almost like a chat room but comments can be commented on. I assume this is done with ajax where it is instant and no page loading but i am not sure. I figured I would start here because I have not had a time where I couldnt find the answer here yet. Thanks in advance.

Link to comment
Share on other sites

ummmm, face book dont use true ajax, more or a beaten up version, chopped down crappy similarity FBML://

.

 

you could write in javascript/ajax/php very simple i can send you a basic script that will do that, or you can use the old fashioned way of iframe refresh.

 

let me know

Link to comment
Share on other sites

sorry to take so long to reply, tis a saturday night afterall lol,

 

asign your div id to somthing like id="thisdiv" or whichever

 

have a script with the output code ready to generate such as ajaxresponse1.php

 

in your running script do a js call either by function call or onclick event

assign JS VAR getvars to whatever you need sending to remote script such as display=2&frog=froggy

 

such as onclick="sndReq('thisdiv','ajaxresponse1.php?'+getvars)"

 

now thisdiv should display what ever output ajaxresponse1.php has :) have fun

function createRequestObject() { 
  var ro; 
  var browser = navigator.appName; 
  if(browser == "Microsoft Internet Explorer"){ 
    ro = new ActiveXObject("Microsoft.XMLHTTP"); 
  }else{ 
    ro = new XMLHttpRequest(); 
  } 
  return ro; 
} 
var http = createRequestObject(); 
var returnDiv 
function sndReq(divRet,file) { 
  var date = new Date();
  var timestamp = date.getTime();
  returnDiv = divRet; 
  http.open('get', file+'&time='+timestamp); 
  http.onreadystatechange = handleResponse; 
  http.send(null); 
} 
function handleResponse() { 
  if(http.readyState == 4){ 
    var response = http.responseText; 
    document.getElementById(returnDiv).innerHTML = response; 
  } 
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.