The following code creates a TF client, which can subscribe to the TF data from the tf2_web_republisher package and update the 3D viewer according to it. Here, we have to mention the fixed frame name, such as Rviz. The fixed frame is already defined in the beginning of our code. For a TurtleBot simulation, it will be odom.
var tfClient = new ROSLIB.TFClient({ ros : ros, fixedFrame : base_frame, angularThres : 0.01, transThres : 0.01, rate : 10.0 });