- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 6
- Posts with Downvotes
- 6
- Downvoting Members
- 5
my connection to **WebSocket** is getting Disconnected continuously. I'm working in folder `realtime` on `localhost`. How to keep WebSocket connection live? How to use WebSocket in javascript? **Link:** http://localhost/realtime/ <script language="javascript" type="text/javascript"> var myWebSocket = new WebSocket("ws://localhost/realtime"); myWebSocket.onopen = function(evt) { alert("Connection open ..."); }; myWebSocket.onmessage = function(evt) { alert( … |
|
How can i return an array from function in c++.. I have this code: #include <iostream> #include <string> using namespace std; int ordincreasente(int num[], int len){ int curMax,curMin,ordinato[len]; for(int i=0; i<(len-1); i++){ for(int j=i+1; j<len; j++){ if(num[i]<num[j]){ swap(num[i], num[j]); } }//end second loop }//end first loop for(int i = 0; … |
|
Hi I am new in php programming and learning this i have found a small problem.I am trying to creating a file called lib.php, where i add all my files jquery lib downloaded in /js and css files.My directory look like this: ** -practise + /css + /js + /images … |
|
Hi, I Have this php code: <?php //require('dbconnection.php'); $conn = mysqli_connect('localhost','root','','user_registration'); if (mysqli_connect_errno()){ echo "Failed to connect to MySQL: " . mysqli_connect_error(); }else{} ; function getUsers() { //return require('online-users.txt'); $getAllUsers = mysqli_query($conn,"SELECT * FROM login"); if($getAllUsers === FALSE) { die(mysqli_error()); // TODO: better error handling } while($rows=mysqli_fetch_array($getAllUsers)){ echo $rows["firstname"]; } … |
|
How can i create a custom protocol with ws scheame ? ex: ws://localhost/echo or ws://localhost:8080/echo with node js ? |
|
Hello, I have a database with MAMP and I have created a music table which contains musicId and musicUrl columns. Now in my websiteI created an HTML player that gets its sources from "src" syntax. The player is fixed at the bottom just like soundcloud player. I want to display … |
|
Hello everyone, I would like to ask you guys that suppose i have an app that i devloped in nodejs and listening on port (3000) , in client side i have added (var io = io.connect();)and domain name is www.domainname.com That node app I developed, I test im my local … |
|
Hi, I have just started learning nodejs. And i am using socket.io modules. I have write code where one user can send message to another specific user.. but my code is not working, idk why ? Here is my client side script --> var mysql = require("mysql"); var fs = … |
|
forexample I can go to [Click Here](http://www.msn.com/) and open developer tools and write this code `document.querySelector('.news a').click()` and it will open news. Now I want a program to do this automatically for me. write a javascript code that do this for me actully this was just a simple example I … |
|
for example I have this html code: <select id="mySelect"> <option value="0">apple</option> <option value="1">orange</option> <option value="2">banana</option> <option value="3">tomato</option> </select> 1-how can I select ` <option value="2">banana</option> ` (by passing the value attribute to selector function)then click on it with javascript with out using jquery 2-Is there any way to select this … |
|
EXPLAIN THE BIND() METHOD IN JAVASCRIPT? |
|
Hi, I have created real time script for my website. I wanted to ask u is it good or bad script? Here is my script: My php page:servr.php <?php set_time_limit(0); $con = mysqli_connect('localhost','root','') or die ("Could not connect to the Database"); mysqli_select_db($con,"msg") or die("Cannot find the database"); $last_id=null; while(1) { … |
|
I have GT-i9000 device. I cannot open any app that is installed in my device. it gives me error when i open any app. Errors: when i open whatsapp i get error: Whatsapp com.process.whatsapp.. and close automatocally after pop up error. when i open playstore error: google process com.google.vending process … |
|
Why my $last_id variable is null always ? i am using this scirpt for ajax..but i tried to excute without my ajax page,it works fine and the output give me `{"data_from_file":"ghjghj","timestamp":1441695735,"msg_id":"1190","reciver_id":"12","sender_id":"10"}` when i want to check my $last_id variable that was null, <?php set_time_limit(0); $con = mysqli_connect('localhost','root','') or die ("Could … |
|
hi i have just started learning nodejs. i wrote this simple code var http = require("http"); var fs=require('fs'); var wbsocket = ('ws'); http.createServer(function(req, res) { res.write('2working'); }).listen(8889); console.log('listing to port 8080'); and run in cmd node filename.js in cmd doesnt give me any error and when i open webbrowser its … |
|
Hello Guys, How can i check if it happend new events in server in real time without refreshing the page with js? I dont want to use node.js or ajax or html5 SSEs. |
|
Hello I would like ask u guys that what does mean `$variablee = isset($_GET['timestamp']) ? $_GET['timestamp'] : 0;` ? what stand for `?` sign and this sign `: 0` ? please someone explain me this code ? |
|
Hello, I would like to ask you that which is good library(angularjs jquery react blabla or simple js)/method/technique to get safe input value from users(to prevent csrf and xss or any other malicious) ? which is more safe `document.getElementById();`or` $('#id/.class');` and what is bind data? explain me this in poor … |
|
What are the differences between **htmlspecialchars()**and **htmlentities()**. When should I use one or the other?Explain me in poor words |
|
I am using jQuery and prototype libarary fro this project. I have this code so far: HTML: <div id="cnt"></div> <input type ="text" id="bla" name="tct"/> Javascript: if(e.keycode == 13){ var text = document.getElementById('#bla'); text= $('#bla').val(); //text.evaljson(); //I put a comment because it gives me error "badly formed json string" $('#cnt').append(text); } … |
|
Help please. My laptop suddenly restart while I'm idling. A message appears: "your PC ran into a problem and needs to restart. We're just collecting some error info, and then we'll restart for you" This repeats in a loop. My laptop won't boot now. Aspire E1-472G. Windows 8.1 |
|
I am trying to creating websocket with php and here is my connection that i used for create socket connection <?php if(!($sock = socket_create(AF_INET, SOCK_STREAM, 0))) { $errorcode = socket_last_error(); $errormsg = socket_strerror($errorcode); die("Couldn't create socket: [$errorcode] $errormsg \n"); } echo "Socket created \n"; //Connect socket to remote server if(!socket_connect($sock … |
|
I am new in programming languages.I was trying to learn web socket with javascript to this [site](http://socket.io/get-started/chat/), but i am not understanding something that why i need to use **Package.json**. I tried to google a lot, but can not find something useful. One more thing if i create Package.json then … |
|
I am new in programming language. I was trying to create an websocket connection, this is my all line of js var url="ws://localhost:8080/WebsocketTests/"; w= new webSocket(url); and i got this error: **C:\xampp\htdocs\WebsocketTests>node test1.js C:\xampp\htdocs\WebsocketTests\test1.js:3 w= new webSocket(url); ^ ReferenceError: webSocket is not defined at Object.<anonymous> (C:\xampp\htdocs\WebsocketTests\test1.js:3:8) at Module._compile (module.js:460:26) at … |
|
How can i get latest fresh data from server if in server happened new event (for exemple there are 2 users x,y and x send message to y and y get message without refresh page like fb chatsystem ) ? I dont want to use setInterval because it repeat all … |
|
Hi eveeryoone, Is it possible that span can have more the one id ? i am tring like this <span id="user Maxi">Maxi</span> <span id="user John">John</span> <span id="user Henry">Henry</span> <span id="user Max">Max</span> <span id="user Simon">Simon</span> #user{ text-align:center; display:inline-block; width:50px; height:20px; background-color:#9B59B6; margin:5px; border:4px solid #3498DB; color:#F1C40F; cursor:pointer; } but it isnt … |
|
What is comet ? Is new programming language like php,js,ajax,python,c++ ecc.. or is it a plugin ? Tell me in summary please. |
|
HELLO i would like to ask that fetchAll() is good choice to retrieve all user message from database or i should use while loop? I asked this question because i worry about internet traffic.. |
|
HI I am getting this error: **Uncaught SyntaxError: Unexpected token function** in line setInterval(function(){ (line 5) Someone can tell me what i wrong done ? $.ajax({ type:"POST", url:'getmessage.php', data:{user_id:id}, setInterval(function(){ success: function(data){ $('.umsg'+id).append(data); }, }, 2000), }); |