1
This server program to pop up a website and autoplay a few songs, the code has run smoothly on windows and android, and the browsers tested form the IE, Firefox, Chrome and Opera. However, I have been trying to run it through a pi Raspberry with the Pipplware OS and the Chromium and Iceweasel browsers. So far I have never been able to get it to work. The following errors appear:
"Uncaught Typeerror: Cannot call method "playFlash" of Undefined"
"Failed to load Resource: the server responded with a status of 404(not found)"
Is it incompatible with browsers? I’m trying to modify the code in a way that makes it functional but I don’t have much experience. Thank you if anyone can help. Thank you. The error code is below on line 127. If further editing is required, I will make available.
$.fn.simulateClick = function() {
return this.each(function() {
if('createEvent' in document) {
var doc = this.ownerDocument,
evt = doc.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, doc.defaultView,
1, 0, 0, 0, 0, false, false, false, false, 0, null);
this.dispatchEvent(evt); // line 127
} else {
this.click(); // IE
}
});
}
To help you understand what the problem is, I will post the full index (already with the changes).
function centrar(caixa){
//Centra uma caixa
$(caixa).css("position","relative");
$(caixa).css("top", ($(window).height() - $(caixa).height()) / 2+$(window).scrollTop() + "px");
if($(caixa).position().top < 0){
$(caixa).css("top",5);
}
}
window.onload = function WindowLoad(event) {
$("#caixa_central").show();
centrar("#caixa_central");
//posicionar_caixa("#caixa_central");
}
//Posiciona a caixa ao fazer rezise
$(window).resize(function() {
centrar("#caixa_central");
//posicionar_caixa("#caixa_central");
});
function radio_janela(id_ambiente){
var dataString = 'id_ambiente=' + id_ambiente;
$.ajax({
type: "POST",
url: "radio.php",
data: dataString,
success: function(data){
$("#pesquisa_resultado").html(data);
}
});
}
/*------------------- Fun��o para pesquisar ------------- */
function pesquisar(){
$.ajax({
type: "POST",
url: "pesquisar.php",
success: function(data){
$("#pesquisa_resultado").html("");
$("#pesquisa_resultado").html(data);
centrar("#caixa_central");
//posicionar_caixa("#caixa_central");
}
});
}
<?php
if(empty($_GET["ambiente"])){
echo "pesquisar();";
} else {
echo "radio_janela(".$_GET["ambiente"].");";
}
?>
var simulateClick = function(controle) {
if (controle) {
if (control.click !== undefined)
controle.click();
else {
if('createEvent' in document) {
var doc = this.ownerDocument,
evt = doc.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, doc.defaultView,1,0,0,0,0, false, false, false, false, 0, null);
this.dispatchEvent(evt);
} else {
this.click(); // IE
}
}
}
else alert("Controle não localizado!");
}
window.setInterval(function(){
$('.edithost').simulateClick();
}, 1000);
Simulate. Click update
$(Document). ready(Function(){
simulateClick(Document.getElementById("id_ambiente")); simulateClick($(".button btn green")[0]) $(".button btn green"). each(Function(){simulateClick(this)}) var simulateClick = Function(control) { if (control) { if (control.click !== Undefined) control.click(); Else { if('createEvent' in Document) { var doc = this.ownerDocument, evt = doc.createEvent('Mouseevents'); evt.initMouseEvent('click', true, true, doc.defaultView,1,0,0,0,0, false, false, false, 0, null); this.dispatchEvent(evt); } Else { this.click(); // IE } } } Else Alert("Control not located!"); }
window.setInterval(function(){
simulateClick($(".edithost")[0]);
}, 1000);
});
By mistake
404
went wrong, could not recover anything from server.– Maicon Carraro
@Maicon Carraro Because, mysql came with some errors initially, along with phpmyadmin, could that also be the case? Some I managed to solve, others not so much. But mysql connecta and works, I just don’t know if it’s 100% or if it’s actually preventing javascript from working. The last mistakes that I was to solve neither conse Gui, because they were terms in which the only solution was "depricated" and there is still no substitute, which is the case of the "can t ceate test file..." and "Can t change dir ...".
– angelfmf