Website crashes on single network but works everywhere else - javascript

Can a old version of jquery (specifically a javascript auto refresh code) crash a website for a single user/local network?
I have a small/simple MySQL database with PHP coded site to insert and retrieve data for internal (non-public) use. It was developed over 4 years ago and still uses jquery-1.2.6.min.js and have had no problems until the past month. Now the site is very random on the operation but only affects the local networks the user I developed it for. It is not a browser crash such as when it goes down the site is unavailable on any computer in the network. Switch to a hotspot or a different building and all works as designed.
I don’t have any reason to think it is website or hosting problem (have talked to hosting support 3 times) but I am trying to cover my bases as the network engineers and ISP tech support are all scratching their heads.
I have used two instances of an auto refresh script 1) to show current time to the user and 2) to refresh the screen with new database content every 15 seconds.
An example on one of the two refresh scripts:
<script type=“text/javascript”>
function load_content({ $(‘#db_content’).load(‘ac_data.php’).hide().show();}
setInterval(‘load_content()’, 15000);
<div id=“db_content”>
<?php require ‘ac_data.php’;?
</div>
Is there any remote chance the code could be to blame since the site has not been updated since original development? I am merely looking for ammo to put the ball back in the network teams court but if there is any chance my code could cause a hang up then I would like to be able to fix it.

Related

BLE web service disconnects after activity is switched

I am developing a basic web app interfacing the Nordic BLE devkit.
I am new to javascript development and came across a rather common but a weird problem for me while testing my app.
Basically, I have 2 html pages and a common javascript file.
First page finds the nearby BLE devices and connects with it and then stores it's characteristics and services which are needed for the communication. (Processing done in the javascript file)
After a button press on the first html the app runs location.replace("path for second html") and switches the activity to the second html file.
Here I noticed that after transferring to the second page the devkit is disconnected.
I have few buttons on the second page which when pressed invokes routines in the javascript file.
Now since the device is disconnected the characteristics and the services read earlier were lost and the app crashes.
I know this is a typical binding problem but I am quite not familiar with the exact javascript concepts that I need to be looking at in order to have more information for this issue.
Can anyone help me with this?
It is not currently possible to transfer a BluetoothDevice or any of the other associated objects to a new page during a navigation (which is what happens when you call location.replace()). If possible you should keep the user on the same page for the entire time that it is connected to a device.
There is upcoming work on Chromium issue 974879 which will make it possible to keep the permission the user granted your site to connect to the device across navigations and sessions but you will still have to reconnect on each page.

Is there really no way to auto-kill unresponsive scripts in Firefox?

So, in our development team we have a computer attached to a big screen. This computer is used as a dashboard. It's running Firefox in full-screen 24/7. It's automatically rotating all open tabs every few minutes and it's automatically reloading these tabs. It's not a huge amount of tabs, currently only 3.
The problem is that every now and then a script on one of these tabs goes completely wild and totally freezes the entire computer. So it takes roughly 10 minutes to kill Firefox's process and restart it. This is really annoying. It happens every few days.
The content (applications) which these tabs show are not under our control, we can't change anything about them. Our only option is to adapt to them as best as possible.
What I want to do is to make Firefox, instead of showing the "unresponsive script" prompt, to automatically kill the script, without the need for any interaction from the user. I don't care if the script is killed. It's only used to render the page and the page will be reloaded in a few minutes anyway.
The thing is that this "freezing" usually happens over night, slowly consuming the computer's resources more & more, so when we come in the morning it's really frozen deep. Like, just hitting ctrl+alt+f1 to bring up a terminal and log in takes several minutes.
I've googled my ass off trying to find a solution for this, but so far I didn't find any. I want it to simply work for like a month without the need for any intervention.
You could run with e10s enabled (available in dev edition) and write an addon that instruments tabs and periodically sends messages to them. if they don't respond within a certain timespan you can kill the content process, close all tabs and reopen them.
Since you say it hangs the entire computer you could also limit the memory available to the process and just restart it via a script when it gets killed due to OOM.

iframe calls by user or server

I am quite new to web programming and trying to get my head around iframes.
So, let us say I have an iframe on my webpage (which is on a server) to the popular bbc site as follows:
<iframe src="http://www.bbc.co.uk"></iframe>
Now, when the user goes to my page, the iframe loads - but, who is making the calls within the iFrame? (i.e the BBC content?) Is it my server or the user?
I guess another way to ask the question is who's IP will bbc's log see in this case? the web servers or the users IP?
Stupid question I suppose, but I just am confused!
The user's web browser would still be making the request.
You can use your browser's developer tools to see this happen and confirm (they usually pop up by pressing F12). Please become comfortable with them as they will be one of your trusty tools for web development in the future. :)
So to answer your question. Regardless of where the page holding the iframe lives, ultimately the user is still making the request therefore their IP should show up.
Your visitor's browser will simply get a whole HTML page from your server and after that it's up to the browser to make do. As a result, all calls like external scripts or images but also iframes will be made by the client.

Javascript timer puzzle

This is a weird scenario I just experienced and I am not sure how to phrase the question.
It may be best to describe my application and what it does 1st.
I have an IP camera connected to my router.
I use a C# VLC wrapper to get 10 frames a second using a RTSP protocol.
I then upload to my web server using a [web method] these seperate jpegs to my server.
Then via browser using a javascript timer set to 100ms it renders the image into a HTML image control by calling an ashx page repteadly.
Now this has worked for a few days OK.
Now this is what I have experienced in the last 48hrs.
The images coming from the IP Camera was jumpy. That is to say sometimes the images flow in a timely order and sometimes it will slow down, stop and speed up again to 'catch up'.
I noticed when viewing via a web browser client on another PC on my network that the javascript timer calls were slow and sometimes stopped for periods of time. I used Google Chrome to view how often the ashx url was being called.
I closed down my own applications. Rebooted all my PCs and started VLC application without using the wrapper. Again, the flow was 'jumpy'. So the conclusion there was that it was not my application.
For some reason I decided to log into my router (192.168.0.1).
Page was not found.
In fact I had to do a complete restart of my router to be able to access my router 'page'.
As soon as I did this everything worked OK again.
So, the 2 questions I have is (1) why could I not access my router through that IP address and (2). Why was my javascript timer crashing to a stand-still?
Like I said this is a weird scenario and I would not blame anyone for wanting to close or vote down this question.
But on the off-chance this is a known thing I would like to be educated.
Thanks

Two browsers on different machines view the same page

I am thinking of a remote help application where a user needs help navigating a web site.
How can a second user see what the first user is seeing so they can help them over the phone.
Could both users interact with the website?
Is there a solution that will work in any browser that requires no special downloads. I can imagine a simple system where the user browser updates the server with the current location URL but how to see the mouse clicks and dynamic Javascript changes etc.
Edit: This is called "cobrowsing" see wikipedia for a list of solutions
Why not use an existing screen-sharing solution, like http://join.me ?
unblu allows two users to interact with the same website
requires no download
works with Javascript/AJAX etc
works of SSL
can be either cloud or privately hosted
There are others that I have not investigated - you can see a list in the cobrowsing wikipedia page.

Categories