Posts: 16
Threads: 2
Joined: Jan 2014
Hi,
I am having some trouble getting jQuery to work as expected on my website. I am Running GetSimple CMS on an Nginx server on a Raspberry Pi.
The problem is that the rest of the website become unresponsive when I have some jQuery script in a Page.
Here is the homepage with the problem occuring:
http://ragebflame.ftp21.net:1080/
This is the code that is currently causing the problems. I have tried a number of different simple example scripts from the net and I get the same result.
Code: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="test" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
<script>
$(function () {
$('#test').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
});
});
</script>
The Highchart works fine, its the rest of the page that is the issue. Hyperlinks, menu items no longer work, etc.
Any help would be greatly appreciated.
Posts: 6,266
Threads: 181
Joined: Sep 2011
my antivirus blocks your site
so maybe thats your problem.
you are including unsafe js in your pages from some other domain, its probably infected.
Posts: 16
Threads: 2
Joined: Jan 2014
(2014-02-06, 07:35:25)shawn_a Wrote: my antivirus blocks your site
so maybe thats your problem.
you are including unsafe js in your pages from some other domain, its probably infected.
Really ? Can I ask what antivirus you are using and what any details of what it is blocking ?
External js being used is:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
Posts: 6,266
Threads: 181
Joined: Sep 2011
it said one of those mal html thingys
Posts: 16
Threads: 2
Joined: Jan 2014
2014-02-06, 08:55:35
(This post was last modified: 2014-02-06, 09:22:50 by ragebflame.)
(2014-02-06, 08:00:21)shawn_a Wrote: it said one of those mal html thingys
Just ran it thorugh VirusTotal. It seems that Sophos is flagging .ftp21.net bacause its dnsdynamic and someone must have been screwing around with an IP using it. False positive in this case though. I dont think that this has anything to do with the issue I am experiencing.
EDIT: you can perform a whois on the domain you will see it is a UPC Ireland host.
Direct Server IP: http://79.97.220.185:1080/
Although this may change, hence the dnsdynamic.
Posts: 6,266
Threads: 181
Joined: Sep 2011
Use chrome or ie11 profiler, it should be able to show what's running. If I had to guess your charting stuff is inefficient or bugged or you have some chart set to live updating or some looping.
Posts: 16
Threads: 2
Joined: Jan 2014
2014-02-06, 20:48:46
(This post was last modified: 2014-02-06, 22:07:51 by ragebflame.)
(2014-02-06, 10:30:53)shawn_a Wrote: Use chrome or ie11 profiler, it should be able to show what's running. If I had to guess your charting stuff is inefficient or bugged or you have some chart set to live updating or some looping.
Good advice, I will try this when I go home. I believe the javascript is fine however. It runs perfect and leaves the page responsive if I throw it into a test page by itself, Outside of GC CMS.
Code: <html>
<head></head>
<body>
<h1>Testing highcharts</h1>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="width:100%; height:400px;"></div>
<script>
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
});
});
</script>
<a href="http://www.w3schools.com/">Visit W3Schools</a>
</body>
</html>
From what I can see, trying to run any jQuery is causing this problem.
Posts: 6,266
Threads: 181
Joined: Sep 2011
Then you have some jquery conflict, does your plugin or theme load its own version of jquery ?
I still cannot test your site, your bootstrap.js throws a mal html virus warning.
bootstrap should not do that, where did you get it from ?
Posts: 16
Threads: 2
Joined: Jan 2014
Good point, I will have a look for jQuery conflicts.
Thats odd, The theme I am using is Twitter-Bootstrap GS: http://get-simple.info/extend/theme/twit...ap-gs/433/
The bootstrap.js would have come with that. That should be fine, I have made no changes.
hmm....
Posts: 6,266
Threads: 181
Joined: Sep 2011
yeah i just installed it and i use it on other sites and i get no warning.
double check yours and make sure it wasn't modified somehow or redownload it and diff it.
I see nothing in it that would cause false positives so either my sophos is wrong or giving wrong file or something. but it is very odd.
Posts: 6,266
Threads: 181
Joined: Sep 2011
Uncaught ReferenceError: $ is not defined (index):134
(anonymous function)
Posts: 16
Threads: 2
Joined: Jan 2014
(2014-02-07, 02:41:25)shawn_a Wrote: Uncaught ReferenceError: $ is not defined (index):134
(anonymous function)
Yes the virus issue is odd. I have yet to investigate that further.
That error was to do with me messing around with the site. I have it to a stage where I think it should be working now but its the same issue. The graph is displaying now and the js console is clear. Still the site remains unresponsive however.
Next thing im going to try is switching the theme to the default. Maybe bootstrap is screwing with it somehow.
Posts: 16
Threads: 2
Joined: Jan 2014
Just switched the theme back to Innovation, the problem still exists. Kind of lost as to where to look now. Not sure if anyone else has a site to test this on ?
Thanks for your help on this so far btw.
Posts: 6,266
Threads: 181
Joined: Sep 2011
have you tried multiple browsers?
Posts: 1,108
Threads: 70
Joined: Aug 2009
i can test on a rpi later on..
but looking at the code, you got 2 jquery libs loading and css/js loading all over the page...
although its not sluggish at all for me...(im on UPC aswell so that might help...8)
Posts: 1,108
Threads: 70
Joined: Aug 2009
you've got this bit of code on your page that turning off all your buttons/links etc...
Code: <script>
$(function() {
$( "input[type=submit], a, button" )
.button()
.click(function( event ) {
event.preventDefault();
});
});
</script>
Posts: 16
Threads: 2
Joined: Jan 2014
(2014-02-07, 07:30:15)n00dles101 Wrote: you've got this bit of code on your page that turning off all your buttons/links etc...
Code: <script>
$(function() {
$( "input[type=submit], a, button" )
.button()
.click(function( event ) {
event.preventDefault();
});
});
</script>
Ah-ha!
Wow I feel like an Idiot, I had that thrown into the sidebar from when I was testing something else. Didnt even think to look at it.
Yeah I need to clean the code up, its all over the place.
It is running really nice on the rpi, I have been logging temp data so I'll see how it fares when it has to render alot more info.
Thanks a million for the help, Much Appreciated!
- Dan
|