I'm storing the values of checked boxes in an array and sending it via AJAX. In console.log(searchIDs) I get the correct o/p of selected checked boxes, but print searchIDs in views.py only prints the last index value, ie if I select One and Two, it will only print Two. Where I'm going wrong?
Here is my code:
<script>
$(function() {
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Add": function() {
var searchIDs = [];
$("#dialog-form input:checkbox:checked").map(function(){
searchIDs.push($(this).val());
});
$.ajax({
type: "POST",
url: "/dashboard/",
data : { 'searchIDs' : searchIDs },
success: function(result){
console.log(searchIDs);
$("#widgets").html(result);
}
});
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
});
$( "#add_widget" ).click(function() {
$( "#dialog-form" ).dialog( "open" );
});
});
</script>
<body>
<div id="dialog-form" title="Create new user">
<input type="checkbox" value="One">One</input><br>
<input type="checkbox" value="Two">Two</input><br>
<input type="checkbox" value="Three">Three</input><br>
<input type="checkbox" value="Four">Four</input><br>
</div>
<div id="widgets" class="ui-widget"></div>
<button id="add_widget">Add Widget</button>
</body>
View.py
if request.is_ajax():
searchIDs = request.POST['searchIDs[]']
print searchIDs
django provides a helper function getlist to help you get a list of ids for a param
request.POST.getlist('searchIDs[]')
Related
I can't get the reviews to displays on a bootstrap card within my web app. I am getting several errors on the front end. Below is the examples, I feel the issue is with my get function that calls on the reviews to be displayed to the front end.
Back end
#app.route("/api/v1.0/movies/<string:id>/movie_reviews", methods=["GET"])
def get_movie_reviews(id):
data_to_return = []
movie = moviescollection.find_one( { "_id" : ObjectId(id) }, { "movie_reviews": 1, "_id": 0 } )
for movie_reviews in movie["movie_reviews"]:
movie_reviews["_id"] = str(movie_reviews["_id"])
data_to_return.append(movie_reviews)
return make_response( jsonify( data_to_return ), 200 )
Movies.component.html
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="card bg-light mb-3" *ngFor="let review of webService.reviews_list | async">
<div class="card-header">
Review by {{ review.name }}
</div>
<div class="card-body">
{{ review.description }}
<hr>
</div>
<div class="card-footer">
</div>
</div>
</div>
</div>
</div>
Movies.component.ts
import { Component } from '#angular/core';
import { ActivatedRoute } from '#angular/router';
import { WebService } from './web.service';
#Component({
selector: 'movies',
templateUrl: './movies.component.html',
styleUrls: ['./movies.component.css']
})
export class MoviesComponent {
constructor(public webService: WebService,
private route: ActivatedRoute) { }
ngOnInit() {
this.webService.getMovies();
this.webService.getReviews(
this.route.snapshot.params.id);
this.webService.moviesSubject
.subscribe(movies => {
this.movie_list = movies
console.log(this.movie_list)
})
};
movie_list;
}
webserive.ts
export class WebService {
private movie_list;
moviesSubject = new Subject();
constructor(private http: HttpClient) { }
getMovies() {
return this.http.get(
'http://localhost:5000/api/v1.0/movies')
.subscribe(response => {
this.movie_list = response;
this.moviesSubject.next(this.movie_list);
})
}
getMovie(id) {
return this.http.get(
'http://localhost:5000/api/v1.0/movies/' + id)
.toPromise();
}
private reviews_private_list;
private reviewsSubject = new Subject<any>();
reviews_list = this.reviewsSubject.asObservable();
getReviews(id) {
return this.http.get(
'http://localhost:5000/api/v1.0/movies/' + id +
'/movie_reviews')
.subscribe(
response => {
this.reviews_private_list = response;
this.reviewsSubject.next(
this.reviews_private_list);
}
)
}
}
I think you have to return the response as HttpResponse
in my html i have this code where the user updating the quantity from the database,why i am encounter this kind of error Forbidden (CSRF token missing or incorrect.): /updatecart_index/ ? eventhought i have this in my form {% csrf_token %}
<form method="POST" id="form" >{% csrf_token %}
<input type="hidden" value="{{bought.id}}" name="itemID">
<input type="submit" value="-" id="down" formaction="/updatecart_index/" onclick="setQuantity('down');" >
<input type="text" name="quantity" id="quantity" value="{{bought.quantity}}" onkeyup="multiplyBy()" style="width: 13%; text-align:left;" readonly>
<input type="submit" value="+" id="up" formaction="/updatecart_index/" onclick="setQuantity('up');" >
</form>
<script type="text/javascript">
$(document).ready(function(){
$("form").submit(function(){
event.preventDefault();
var form_id = $('#form')
$.ajax({
url: "{% url 'updatecart_index' %}",
type: 'POST',
data: form_id.serialize(),
header: {'X-CSRFToken': '{% csrf_token %}'},
dataType: "json",
success: function (response){
var success = response['success']
if(success){
alert("form submittend");
}else{
alert("got error");
}
},
failure: function (error){
alert("Error occured while calling Django view")
}
})
});
});
</script>
in views.py
def updatecart_index(request):
item = request.POST.get("itemID")
print("dasdasd")
quantity = request.POST.get("quantity")
product = CustomerPurchaseOrderDetail.objects.get(id=item)
print("aa", CustomerPurchaseOrderDetail.objects.get(id=item))
product.quantity = quantity
product.save()
data = {}
data['success'] = True
return HttpResponse(json.dumps(data), content_type="application/json")
UPDATE
when i tried #csrf_exempt in views.py, the request.POST.get("item") didnt get the data from the html
You can simply do this to you Ajax
<script type="text/javascript">
$(document).ready(function(){
$('form').submit(function(){
event.preventDefault();
var that = $(this);
$.ajax({
url: "{% url 'updatecart_index' %}",
type: 'POST',
data: that.serialize()
,success: function(data){
console.log('Success!');
}
});
return false;
});
});
</script>
and dont use csrf_exempt
You must get the csrf_token from the HTML - after it's rendered. Because Django replaces {% csrf_token %} with a unique token (input type="hidden", actually), so it'll be incorrect. The token in your JS and the token in your form will be different.
<script type="text/javascript">
$(document).ready(function () {
$("form").submit(function () {
event.preventDefault();
var form_id = $("#form");
$.ajaxSetup({
beforeSend: function (xhr, settings) {
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != "") {
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == name + "=") {
cookieValue = decodeURIComponent(
cookie.substring(name.length + 1)
);
break;
}
}
}
return cookieValue;
}
if (
!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))
) {
// Only send the token to relative URLs i.e. locally.
xhr.setRequestHeader("X-CSRFToken", getCookie("csrftoken"));
}
},
});
$.ajax({
url: "{% url 'updatecart_index' %}",
type: "POST",
data: form_id.serialize(),
dataType: "json",
success: function (response) {
var success = response["success"];
if (success) {
alert("form submittend");
} else {
alert("got error");
}
},
failure: function (error) {
alert("Error occured while calling Django view");
},
});
});
});
</script>
I am getting really confused on what to do here. I have a python script that does some cool things and then should display those cool things via some charts.
The way I've seen it's done is via Flask and ChartJS, but every website that I've seen uses it to display static content, which, of course, is not what I need.
I've tried doing this with this template:
<!doctype html>
<html>
<head>
<title>Line Chart</title>
<script src="/static/chartjs/Chart.min.js"></script>
<script src="/static/chartjs/utils.js"></script>
<style>
canvas{
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
</head>
<body>
<div style="width:75%;">
<canvas id="canvas"></canvas>
</div>
<br>
<br>
<button id="randomizeData">Randomize Data</button>
<button id="addDataset">Add Dataset</button>
<button id="removeDataset">Remove Dataset</button>
<button id="addData">Add Data</button>
<button id="removeData">Remove Data</button>
<script>
var MONTHS = [];
var config = {
type: 'line',
data: {
labels: ['1/05/19\n00:57', '1/05/19\n00:58', '1/05/19\n00:59', '1/05/19\n01:00', '1/05/19\n01:01', '1/05/19\n01:02', '1/05/19\n01:03'],
{{ dataset }}
},
options: {
responsive: true,
title: {
display: true,
text: 'Chart.js Line Chart'
},
tooltips: {
mode: 'index',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Month'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Value'
}
}]
}
}
};
window.onload = function() {
var ctx = document.getElementById('canvas').getContext('2d');
window.myLine = new Chart(ctx, config);
};
document.getElementById('randomizeData').addEventListener('click', function() {
config.data.datasets.forEach(function(dataset) {
dataset.data = dataset.data.map(function() {
return randomScalingFactor();
});
});
window.myLine.update();
});
var colorNames = Object.keys(window.chartColors);
document.getElementById('addDataset').addEventListener('click', function() {
var colorName = colorNames[config.data.datasets.length % colorNames.length];
var newColor = window.chartColors[colorName];
var newDataset = {
label: 'Dataset ' + config.data.datasets.length,
backgroundColor: newColor,
borderColor: newColor,
data: [],
fill: false
};
for (var index = 0; index < config.data.labels.length; ++index) {
newDataset.data.push(randomScalingFactor());
}
config.data.datasets.push(newDataset);
window.myLine.update();
});
document.getElementById('addData').addEventListener('click', function() {
if (config.data.datasets.length > 0) {
var month = MONTHS[1];
config.data.labels.push(month);
config.data.datasets.forEach(function(dataset) {
dataset.data.push(randomScalingFactor());
});
window.myLine.update();
}
});
document.getElementById('removeDataset').addEventListener('click', function() {
config.data.datasets.splice(0, 1);
window.myLine.update();
});
document.getElementById('removeData').addEventListener('click', function() {
config.data.labels.splice(-1, 1); // remove the label first
config.data.datasets.forEach(function(dataset) {
dataset.data.pop();
});
window.myLine.update();
});
</script>
</body>
</html>
This contains a lot of unused stuff (it was downloaded directly from the chart.js samples) and slightly altered by me (see {{ dataset }})
And this is the python code I use to generate the dataset part:
def generate_dataset(self):
data = 'datasets: ['
for post_list_index, post in enumerate(self.post_list):
data = data + "{label: '" + post + "', backgroundColor: window.chartColors.red, borderColor: window.chartColors.red, data: ["
for index, history in enumerate(self.submissions_score_history):
score = history[post_list_index]
if index < len(self.submissions_score_history) - 1:
data = data + str(score) + ','
else:
data = data + str(score)
data = data + '],fill: false,}'
if post_list_index < len(self.post_list) - 1:
data = data + ','
else:
pass
data = data + ']'
return data
Now, unfortunately, this doesnt render anything. I'm pretty sure that this is due to the label: 'label'; being escaped to 'label'.
I've searched about this issue and apparently this javascript injection thing I'm attempting to do has been removed because it represents a security vulnerability.
This project is quite literally just a dashboard for another small python project that will be used by me only, so I was trying to build something quickly and easily, but this is turning out to be quite troublesome :/
Application is receiving data in real time (checked using alert) while to display it on the card, it gives error Internal Server Error
Same Code is running well as an independent html page but not in flask python web app.
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"
crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<title>Cosmos DB Change Feed</title>
<style>
.fade-enter-active {
transition: all 1.5s ease;
}
.fade-enter, .fade-leave-to {
opacity: 0;
}
</style>
</head>
<body>
Welcome new
<div class="container" id="app">
<div class="row">
<div v-for="flight in flights" class="col-md-6 col-lg-4 col-xl-3" style="margin: 16px 0px;">
<div class="card">
<div class="card-body">
<h4 class="card-title">{{ flight.from }} <i class="fas fa-plane"></i> {{ flight.to }}</h4>
<transition name="fade" mode="out-in">
<h4 class="card-subtitle mb-2" :key="flight.price">${{ flight.price }}</h4>
</transition>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue#2.5.16/dist/vue.js"></script>
<script src="https://unpkg.com/#aspnet/signalr#1.0.2/dist/browser/signalr.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
const apiBaseUrl = 'http://localhost:7071'
const axiosConfig = {}
const data = {
flights: []
}
const app = new Vue({
el: '#app',
data: data
})
getFlights().then(function (flights) {
flights.forEach(flightUpdated)
}).then(getConnectionInfo).then(function (info) {
let accessToken = info.accessToken
const options = {
accessTokenFactory: function () {
if (accessToken) {
const _accessToken = accessToken
accessToken = null
return _accessToken
} else {
return getConnectionInfo().then(function (info) {
return info.accessToken
})
}
}
}
const connection = new signalR.HubConnectionBuilder()
.withUrl(info.url, options)
.build()
connection.on('flightUpdated', flightUpdated)
connection.onclose(function () {
console.log('disconnected')
setTimeout(function () { startConnection(connection) }, 2000)
})
startConnection(connection)
}).catch(console.error)
function startConnection(connection) {
console.log('connecting...')
connection.start()
.then(function () { console.log('connected!') })
.catch(function (err) {
console.error(err)
setTimeout(function () { startConnection(connection) }, 2000)
})
}
function getFlights() {
return axios.post(`${apiBaseUrl}/api/GetFlights`, null, axiosConfig)
.then(function (resp) { return resp.data })
.catch(function () { return {} })
}
function getConnectionInfo() {
return axios.post(`${apiBaseUrl}/api/SignalRInfo`, null, axiosConfig)
.then(function (resp) { return resp.data })
.catch(function () { return {} })
}
function flightUpdated(updatedFlight) {
const flight = data.flights.find(f => (f.to === updatedFlight.to && f.from === updatedFlight.from))
//const flight = data.flights.find(f =>f.id === updatedFlight.id)
if (flight) {
// alert(updatedFlight.price);
//Vue.set(flight, 'from', updatedFlight.from)
// Vue.set(flight, 'to', updatedFlight.to)
Vue.set(flight, 'price', updatedFlight.price)
} else {
// alert(updatedFlight.price);
data.flights.push(updatedFlight)
}
}
</script>
</body>
</html>
Expected Result is flight details (from, to , price) in the card format. I believe it is due to {{flight.to}} syntax, I don't know how to replace it.
If the application is giving an internal server error, you're probably running it in production mode.
On your development machine,
If you're using app.run to the app, change
app.run()
to
app.run(debug=True)
However, if you're using
flask run
Then, depending on your system, you'll need to add an environment variable, information about it is very nicely explained with other configurations.
Flask Environment Configuration
When you enable the debug mode, the inbuilt debugger will tell you exactly where it ran into a problem.
I'm trying to scrap a website and I've got COOKIE_ENABLED set to true, however sometimes I get the following response from the request:
Where the corresponding response html is:
<html>
<head><base href="http://www.yad2.co.il/Nadlan/sales_info.php?NadlanID=4b3746939d3ab7d5be7c38efab70f0b59e0">
<title></title>
<meta http-equiv="Expires" content="28FEB2002" />
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
<script type="text/javascript">
function addFields(formObj) { } function redirect(commitType) { var cookieenabled = false; if (navigator.cookieEnabled) { if (navigator.cookieEnabled==true) { var exdate=new Date(); exdate.setDate(exdate.getDate()+1); document.cookie="PRID=" +escape(genPid())+";path=/; expires="+exdate.toGMTString()+"; domain=.yad2.co.il"; cookieenabled=(document.cookie.indexOf("PRID")!=-1)? true : false; } } if (cookieenabled) { if (commitType=="reload") window.location.reload(true); else { var oFrm = document.createElement("form"); var oEnvlp = document.getElementById("frmPlsHldr"); oFrm.method = "post"; addFields(oFrm); oEnvlp.appendChild (oFrm); oFrm.submit(); } } else { var oJSCookieMSGObj = document.getElementById('JSCookieMSG'); oJSCookieMSGObj.style.display = 'block'; } }
</script>
</head>
<body style="background-color:white">
<div style='display:none' id='sbbhscc'></div><script type="text/javascript">sbbvscc='%3c%73%65%6c%65%63%74%20%69%64%3d"%73%62%62%5f%45%75%68%51%50%49%58%72"%20%73%74%79%6c%65%3d"%64%69%73%70%6c%61%79%3a%6e%6f%6e%65"%3e%3c%6f%70%74%69%6f%6e%20%20%76%61%6c%75%65%3d%27%79%44%51%76%4f%27%3e%73%48%42%3c%2f%6f%70%74%69%6f%6e%3e%3c%6f%70%74%69%6f%6e%20%20%53%45%4c%45%43%54%45%44%20%20%76%61%6c%75%65%3d%27%4c%6f%79%74%27%3e%79%68%71%6e%4f%4b%3c%2f%6f%70%74%69%6f%6e%3e%3c%6f%70%74%69%6f%6e%20%20%76%61%6c%75%65%3d%27%49%43%46%62%71%45%27%3e%63%66%45%67%3c%2f%6f%70%74%69%6f%6e%3e%3c%6f%70%74%69%6f%6e%20%20%76%61%6c%75%65%3d%27%57%62%56%69%27%3e%75%58%77%44%4b%3c%2f%6f%70%74%69%6f%6e%3e%3c%6f%70%74%69%6f%6e%20%20%76%61%6c%75%65%3d%27%75%4b%76%57%4c%27%3e%47%6b%48%3c%2f%6f%70%74%69%6f%6e%3e%3c%6f%70%74%69%6f%6e%20%20%76%61%6c%75%65%3d%27%52%4c%54%4a%27%3e%77%44%55%3c%2f%6f%70%74%69%6f%6e%3e%3c%6f%70%74%69%6f%6e%20%20%76%61%6c%75%65%3d%27%5a%44%71%27%3e%4e%78%49%3c%2f%6f%70%74%69%6f%6e%3e%3c%2f%73%65%6c%65%63%74%3e%3c%66%6f%72%6d%20%69%64%3d"%73%62%62%5f%6e%4c%73%52%7a"%20%6d%65%74%68%6f%64%3d"%70%6f%73%74"%20%73%74%79%6c%65%3d"%64%69%73%70%6c%61%79%3a%6e%6f%6e%65"%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%76%61%6c%75%65%3d%27%4a%42%77%27%2f%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%76%61%6c%75%65%3d%27%57%5a%4a%27%2f%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%76%61%6c%75%65%3d%27%70%42%72%73%6e%27%2f%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%76%61%6c%75%65%3d%27%47%46%70%41%4d%27%2f%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%76%61%6c%75%65%3d%27%6b%77%74%79%61%7a%42%27%2f%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%76%61%6c%75%65%3d%27%45%67%42%46%27%2f%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%76%61%6c%75%65%3d%27%4c%64%72%62%68%4d%27%2f%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%43%48%45%43%4b%45%44%20%20%76%61%6c%75%65%3d%27%56%72%57%78%49%27%2f%3e%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%20%74%79%70%65%3d%27%63%68%65%63%6b%62%6f%78%27%20%20%76%61%6c%75%65%3d%27%6c%65%41%76%78%53%27%2f%3e%3c%2f%66%6f%72%6d%3e'; sbbgscc='%66%75%6e%63%74%69%6f%6e%20%73%62%62%5f%46%67%75%28%29%20%7b%20%20%73%62%62%4f%62%6a%20%3d%20%64%6f%63%75%6d%65%6e%74%2e%67%65%74%45%6c%65%6d%65%6e%74%42%79%49%64%28%27%73%62%62%5f%45%75%68%51%50%49%58%72%27%29%3b%20%73%62%62%4f%62%6a%2e%6f%70%74%69%6f%6e%73%5b%32%5d%2e%73%65%6c%65%63%74%65%64%20%3d%20%74%72%75%65%3b%20%72%65%74%75%72%6e%20%73%62%62%4f%62%6a%2e%6f%70%74%69%6f%6e%73%5b%73%62%62%4f%62%6a%2e%73%65%6c%65%63%74%65%64%49%6e%64%65%78%5d%2e%74%65%78%74%2e%73%75%62%73%74%72%28%32%2c%31%29%3b%20%7d%66%75%6e%63%74%69%6f%6e%20%73%62%62%5f%73%76%77%65%28%29%20%7b%20%66%75%6e%63%74%69%6f%6e%20%73%62%62%5f%74%69%78%47%6d%41%28%6f%62%6a%41%72%72%29%20%7b%20%76%61%72%20%74%73%3d%27%27%3b%20%66%6f%72%20%28%69%3d%30%3b%20%69%3c%6f%62%6a%41%72%72%2e%6c%65%6e%67%74%68%3b%20%69%2b%2b%29%20%7b%69%66%20%28%6f%62%6a%41%72%72%5b%69%5d%2e%63%68%65%63%6b%65%64%20%3d%3d%20%74%72%75%65%29%20%74%73%20%2b%3d%6f%62%6a%41%72%72%5b%69%5d%2e%76%61%6c%75%65%3b%7d%20%72%65%74%75%72%6e%20%74%73%3b%7d%20%73%62%62%4f%62%6a%20%3d%20%64%6f%63%75%6d%65%6e%74%2e%67%65%74%45%6c%65%6d%65%6e%74%73%42%79%4e%61%6d%65%28%27%73%62%62%5f%64%42%4b%78%54%59%4f%66%27%29%3b%20%73%62%62%46%72%6d%3d%64%6f%63%75%6d%65%6e%74%2e%67%65%74%45%6c%65%6d%65%6e%74%42%79%49%64%28%27%73%62%62%5f%6e%4c%73%52%7a%27%29%3b%20%73%62%62%4f%62%6a%5b%31%5d%2e%63%68%65%63%6b%65%64%20%3d%20%74%72%75%65%3b%20%78%3d%73%62%62%5f%74%69%78%47%6d%41%28%73%62%62%46%72%6d%2e%73%62%62%5f%64%42%4b%78%54%59%4f%66%29%3b%20%72%65%74%75%72%6e%20%78%2e%73%75%62%73%74%72%28%35%2c%31%29%3b%20%7d; function genPid() {return %73%62%62%5f%46%67%75%28%29+%73%62%62%5f%73%76%77%65%28%29; }';</script><div id='sbbfrcc' style='position: absolute; top: -10px; left: 30px; font-size:1px'></div>
<div id='JSCookieMSG' style="display:none"><big><b>Server Notice:</b></big><br/>
Please activate browser cookies to view this site.
<br/><br/>
Incident Id: 585436913aa5b
</div>
<div id='JSOffMSG'><noscript><big><b>Server Notice:</b></big><br/>
Please activate javascript to view this site.
<br/><br/>
Incident Id: 585436913aa5b
</noscript></div>
<div id='frmPlsHldr'></div>
<script type="text/javascript">
oJSOffMSG = document.getElementById('JSOffMSG'); oJSOffMSG.style.display = 'none'; try{ y=unescape(sbbvscc.replace(/^<\!\-\-\s*|\s*\-\->$/g,'')); document.getElementById('sbbhscc').innerHTML=y; x=unescape(sbbgscc.replace(/^<\!\-\-\s*|\s*\-\->$/g,'')); } catch(e){ x='function genPid() {return "jser"; }'; } document.write ('<'+'script type="text/javascri'+'pt">'+x+' redirect("reload");</'+'script>');
</script>
</body>
</html>
This seems to happen on and off and I have no idea what's going on.
Has anyone come across something similar?